Show coin a lock tx blocks confirmed.

This commit is contained in:
tecnovert
2020-12-10 16:37:26 +02:00
parent 645571e47c
commit 2979b3e244
5 changed files with 45 additions and 26 deletions

View File

@@ -152,7 +152,10 @@ def describeBid(swap_client, bid, offer, edit_bid, show_txns):
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()})
confirms = None
if swap_client.coin_clients[ci_from.coin_type()]['last_height'] and bid.xmr_a_lock_tx.chain_height:
confirms = swap_client.coin_clients[ci_from.coin_type()]['last_height'] - bid.xmr_a_lock_tx.chain_height
txns.append({'type': 'Chain A Lock', 'txid': bid.xmr_a_lock_tx.txid.hex(), 'confirms': confirms})
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:
@@ -162,7 +165,6 @@ def describeBid(swap_client, bid, offer, edit_bid, show_txns):
txns.append({'type': 'Chain B Lock', 'txid': bid.xmr_b_lock_tx.txid.hex(), 'confirms': confirms})
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