Small fixes.

This commit is contained in:
tecnovert 2019-07-27 23:34:15 +02:00
parent cf73707643
commit 3c5577c3e1
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
2 changed files with 11 additions and 9 deletions

View file

@ -515,8 +515,10 @@ class BasicSwap():
self.addWatchedOutput(coin_to, bid.bid_id, bid.participate_tx.txid.hex(), bid.participate_tx.vout, BidStates.SWAP_PARTICIPATING) self.addWatchedOutput(coin_to, bid.bid_id, bid.participate_tx.txid.hex(), bid.participate_tx.vout, BidStates.SWAP_PARTICIPATING)
if self.coin_clients[coin_from]['last_height_checked'] < 1: if self.coin_clients[coin_from]['last_height_checked'] < 1:
if bid.initiate_tx and bid.initiate_tx.chain_height:
self.coin_clients[coin_from]['last_height_checked'] = bid.initiate_tx.chain_height self.coin_clients[coin_from]['last_height_checked'] = bid.initiate_tx.chain_height
if self.coin_clients[coin_to]['last_height_checked'] < 1: if self.coin_clients[coin_to]['last_height_checked'] < 1:
if bid.participate_tx and bid.participate_tx.chain_height:
self.coin_clients[coin_to]['last_height_checked'] = bid.participate_tx.chain_height self.coin_clients[coin_to]['last_height_checked'] = bid.participate_tx.chain_height
finally: finally:

View file

@ -59,9 +59,9 @@ def getTxIdHex(bid, tx_type, prefix):
return 'Unknown Type' return 'Unknown Type'
if not obj: if not obj:
return None return 'None'
if not obj.txid: if not obj.txid:
return None return 'None'
return obj.txid.hex() + prefix return obj.txid.hex() + prefix
@ -74,10 +74,10 @@ def getTxSpendHex(bid, tx_type):
return 'Unknown Type' return 'Unknown Type'
if not obj: if not obj:
return None return 'None'
if not obj.spend_txid: if not obj.spend_txid:
return None return 'None'
obj.spend_txid.hex() + ' {}'.format(obj.spend_n) return obj.spend_txid.hex() + ' {}'.format(obj.spend_n)
def html_content_start(title, h2=None, refresh=None): def html_content_start(title, h2=None, refresh=None):
@ -469,8 +469,8 @@ class HttpHandler(BaseHTTPRequestHandler):
if show_txns: if show_txns:
data['initiate_tx_refund'] = 'None' if not bid.initiate_txn_refund else bid.initiate_txn_refund.hex() 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['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['initiate_tx_spend'] = getTxSpendHex(bid, TxTypes.ITX)
data['participate_tx_spend'] = getTxSpendHex(bid, TxTypes.PTX), data['participate_tx_spend'] = getTxSpendHex(bid, TxTypes.PTX)
old_states = [] old_states = []
num_states = len(bid.states) // 12 num_states = len(bid.states) // 12