mirror of
https://github.com/basicswap/basicswap.git
synced 2026-06-10 21:11:41 +02:00
refactor: add haveSignedLockRefundTx
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user