xmr: Check for existing spend of lock tx

This commit is contained in:
tecnovert
2021-11-12 16:36:10 +02:00
parent 0f8ed24217
commit eff5235205
5 changed files with 57 additions and 27 deletions

View File

@@ -73,6 +73,7 @@ class BidStates(IntEnum):
XMR_SWAP_NOSCRIPT_COIN_LOCKED = auto()
XMR_SWAP_LOCK_RELEASED = auto()
XMR_SWAP_SCRIPT_TX_REDEEMED = auto()
XMR_SWAP_SCRIPT_TX_PREREFUND = auto() # script txo moved into pre-refund tx
XMR_SWAP_NOSCRIPT_TX_REDEEMED = auto()
XMR_SWAP_NOSCRIPT_TX_RECOVERED = auto()
XMR_SWAP_FAILED_REFUNDED = auto()
@@ -279,7 +280,7 @@ def describeEventEntry(event_type, event_msg):
if event_type == EventLogTypes.LOCK_TX_B_PUBLISHED:
return 'Lock tx B published'
if event_type == EventLogTypes.FAILED_TX_B_SPEND:
return 'Failed to publish lock tx B spend'
return 'Failed to publish lock tx B spend: ' + event_msg
if event_type == EventLogTypes.LOCK_TX_A_SEEN:
return 'Lock tx A seen in chain'
if event_type == EventLogTypes.LOCK_TX_A_CONFIRMED:
@@ -370,4 +371,6 @@ def isActiveBidState(state):
return True
if state == BidStates.XMR_SWAP_SCRIPT_TX_REDEEMED:
return True
if state == BidStates.XMR_SWAP_SCRIPT_TX_PREREFUND:
return True
return False