Call setLastHeightChecked() in watchXmrSwap()

Remove old notes and config.
New html template for XMR bids.
Check the mempool for lock spend txid.
Retry sepnding coin B lock tx.
This commit is contained in:
tecnovert
2020-12-06 19:34:56 +02:00
parent 4c200fe8d4
commit 2346858145
21 changed files with 284 additions and 187 deletions

View File

@@ -13,9 +13,11 @@ from .chainparams import (
Coins,
)
from .basicswap import (
SwapTypes,
BidStates,
TxStates,
TxTypes,
strTxType,
strBidState,
strTxState,
)
@@ -147,9 +149,24 @@ def describeBid(swap_client, bid, offer, edit_bid, show_txns):
data['bid_states'] = listBidStates()
if show_txns:
data['initiate_tx_refund'] = 'None' if not bid.initiate_txn_refund else bid.initiate_txn_refund.hex()
data['participate_tx_refund'] = 'None' if not bid.participate_txn_refund else bid.participate_txn_refund.hex()
data['initiate_tx_spend'] = getTxSpendHex(bid, TxTypes.ITX)
data['participate_tx_spend'] = getTxSpendHex(bid, TxTypes.PTX)
if offer.swap_type == SwapTypes.XMR_SWAP:
txns = []
if bid.xmr_a_lock_tx:
txns.append({'type': 'Chain A Lock', 'txid': bid.xmr_a_lock_tx.txid.hex()})
if bid.xmr_a_lock_spend_tx:
txns.append({'type': 'Chain A Lock Spend', 'txid': bid.xmr_a_lock_spend_tx.txid.hex()})
if bid.xmr_b_lock_tx:
txns.append({'type': 'Chain B Lock', 'txid': bid.xmr_b_lock_tx.txid.hex()})
if bid.xmr_b_lock_tx and bid.xmr_b_lock_tx.spend_txid:
txns.append({'type': 'Chain B Lock Spend', 'txid': bid.xmr_b_lock_tx.spend_txid.hex()})
for tx_type, tx in bid.txns.items():
txns.append({'type': strTxType(tx_type), 'txid': tx.txid.hex()})
data['txns'] = txns
else:
data['initiate_tx_refund'] = 'None' if not bid.initiate_txn_refund else bid.initiate_txn_refund.hex()
data['participate_tx_refund'] = 'None' if not bid.participate_txn_refund else bid.participate_txn_refund.hex()
data['initiate_tx_spend'] = getTxSpendHex(bid, TxTypes.ITX)
data['participate_tx_spend'] = getTxSpendHex(bid, TxTypes.PTX)
return data