refactor: add haveSignedLockRefundTx

This commit is contained in:
tecnovert
2026-06-09 19:10:48 +02:00
parent 0bc3226ed9
commit 8cc5d808fa
3 changed files with 21 additions and 3 deletions
+1 -2
View File
@@ -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,
+15 -1
View File
@@ -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):
+5
View File
@@ -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