mirror of
https://github.com/basicswap/basicswap.git
synced 2026-04-09 02:47:22 +02:00
Improve auto-accept
This commit is contained in:
@@ -25,6 +25,7 @@ from basicswap.basicswap_util import (
|
||||
BidStates,
|
||||
SwapTypes,
|
||||
DebugTypes,
|
||||
canAcceptBidState,
|
||||
strTxState,
|
||||
strBidState,
|
||||
)
|
||||
@@ -124,7 +125,7 @@ def page_bid(self, url_split, post_string):
|
||||
|
||||
if len(data["addr_from_label"]) > 0:
|
||||
data["addr_from_label"] = "(" + data["addr_from_label"] + ")"
|
||||
data["can_accept_bid"] = True if bid.state == BidStates.BID_RECEIVED else False
|
||||
data["can_accept_bid"] = True if canAcceptBidState(bid.state) else False
|
||||
|
||||
if swap_client.debug_ui:
|
||||
data["bid_actions"] = [
|
||||
|
||||
@@ -20,6 +20,7 @@ from basicswap.basicswap_util import (
|
||||
ActionTypes,
|
||||
BidStates,
|
||||
DebugTypes,
|
||||
canAcceptBidState,
|
||||
getLastBidState,
|
||||
strBidState,
|
||||
strTxState,
|
||||
@@ -258,7 +259,7 @@ def describeBid(
|
||||
if bid.state == BidStates.BID_RECEIVING:
|
||||
# Offerer receiving bid from bidder
|
||||
state_description = "Waiting for bid to be fully received"
|
||||
elif bid.state == BidStates.BID_RECEIVED:
|
||||
elif canAcceptBidState(bid.state):
|
||||
# Offerer received bid from bidder
|
||||
# TODO: Manual vs automatic
|
||||
state_description = "Bid must be accepted"
|
||||
@@ -270,7 +271,7 @@ def describeBid(
|
||||
)
|
||||
elif bid.state == BidStates.SWAP_DELAYING:
|
||||
last_state = getLastBidState(bid.states)
|
||||
if last_state == BidStates.BID_RECEIVED:
|
||||
if canAcceptBidState(last_state):
|
||||
state_description = "Delaying before accepting bid"
|
||||
elif last_state == BidStates.BID_RECEIVING_ACC:
|
||||
state_description = "Delaying before responding to accepted bid"
|
||||
|
||||
Reference in New Issue
Block a user