diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 726ad2c..e2e12c1 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -7938,8 +7938,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): return rv else: # not XMR_SWAP_A_LOCK_REFUND in bid.txns if ( - len(xmr_swap.al_lock_refund_tx_sig) > 0 - and len(xmr_swap.af_lock_refund_tx_sig) > 0 + ci_from.haveSignedLockRefundTx(xmr_swap) and bid.xmr_a_lock_tx is not None and ci_from.isCsvLockMature( offer.lock_type, diff --git a/basicswap/interface/base.py b/basicswap/interface/base.py index 26747aa..ee73210 100644 --- a/basicswap/interface/base.py +++ b/basicswap/interface/base.py @@ -192,9 +192,23 @@ class AdaptorSigInterface: def getScriptLockRefundSwipeTxDummyWitness(self, script: bytes) -> List[bytes]: return [bytes(72), b"", bytes(len(script))] - def getLockRefundVout(self, lock_refund_tx_data: bytes, vbkv: bytes): + def getLockRefundVout(self, lock_refund_tx_data: bytes, vbkv: bytes) -> int: return 0 + def haveSignedLockRefundTx(self, xmr_swap) -> bool: + if xmr_swap.a_lock_refund_tx is None: + return False + if ( + xmr_swap.al_lock_refund_tx_sig is None + or xmr_swap.af_lock_refund_tx_sig is None + ): + return False + + return ( + len(xmr_swap.al_lock_refund_tx_sig) > 0 + and len(xmr_swap.af_lock_refund_tx_sig) > 0 + ) + class Secp256k1Interface(CoinInterface, AdaptorSigInterface): def __init__(self, **kwargs): diff --git a/basicswap/interface/bch.py b/basicswap/interface/bch.py index 2c71f4a..c152984 100644 --- a/basicswap/interface/bch.py +++ b/basicswap/interface/bch.py @@ -1198,3 +1198,8 @@ class BCHInterface(BTCInterface): txHex = tx.serialize_without_witness() return self.signTxWithWallet(txHex) + + def haveSignedLockRefundTx(self, xmr_swap) -> bool: + if xmr_swap.a_lock_refund_tx is None: + return False + return True