Fix bug when manually redeeming noscript lock tx with invalid amount.
This commit is contained in:
parent
efb0b08ac9
commit
65951220b8
@ -1,3 +1,3 @@
|
|||||||
name = "basicswap"
|
name = "basicswap"
|
||||||
|
|
||||||
__version__ = "0.0.29"
|
__version__ = "0.0.30"
|
||||||
|
@ -3074,13 +3074,14 @@ class BasicSwap(BaseApp):
|
|||||||
p2wsh_addr = ci_from.encode_p2wsh(a_lock_refund_tx_dest)
|
p2wsh_addr = ci_from.encode_p2wsh(a_lock_refund_tx_dest)
|
||||||
lock_refund_tx_chain_info = ci_from.getLockTxHeight(refund_tx.txid, p2wsh_addr, 0, bid.chain_a_height_start)
|
lock_refund_tx_chain_info = ci_from.getLockTxHeight(refund_tx.txid, p2wsh_addr, 0, bid.chain_a_height_start)
|
||||||
|
|
||||||
block_header = ci_from.getBlockHeaderFromHeight(lock_refund_tx_chain_info['height'])
|
if lock_refund_tx_chain_info is not None:
|
||||||
refund_tx.block_hash = bytes.fromhex(block_header['hash'])
|
block_header = ci_from.getBlockHeaderFromHeight(lock_refund_tx_chain_info['height'])
|
||||||
refund_tx.block_height = block_header['height']
|
refund_tx.block_hash = bytes.fromhex(block_header['hash'])
|
||||||
refund_tx.block_time = block_header['time'] # Or median_time?
|
refund_tx.block_height = block_header['height']
|
||||||
|
refund_tx.block_time = block_header['time'] # Or median_time?
|
||||||
|
|
||||||
self.saveBidInSession(bid_id, bid, session, xmr_swap)
|
self.saveBidInSession(bid_id, bid, session, xmr_swap)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
raise ex
|
raise ex
|
||||||
|
@ -975,6 +975,7 @@ class BTCInterface(CoinInterface):
|
|||||||
'height': block_height}
|
'height': block_height}
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
self._log.debug('getLockTxHeight gettransaction failed: %s, %s', txid.hex(), str(e))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if find_index:
|
if find_index:
|
||||||
|
@ -406,13 +406,14 @@ class XMRInterface(CoinInterface):
|
|||||||
|
|
||||||
if rv['balance'] < cb_swap_value:
|
if rv['balance'] < cb_swap_value:
|
||||||
self._log.warning('Balance is too low, checking for existing spend.')
|
self._log.warning('Balance is too low, checking for existing spend.')
|
||||||
txns = self.rpc_wallet_cb('get_transfers', {'out': True})['out']
|
txns = self.rpc_wallet_cb('get_transfers', {'out': True})
|
||||||
print(txns, txns)
|
if 'out' in txns:
|
||||||
if len(txns) > 0:
|
txns = txns['out']
|
||||||
txid = txns[0]['txid']
|
if len(txns) > 0:
|
||||||
self._log.warning(f'spendBLockTx detected spending tx: {txid}.')
|
txid = txns[0]['txid']
|
||||||
if txns[0]['address'] == address_b58:
|
self._log.warning(f'spendBLockTx detected spending tx: {txid}.')
|
||||||
return bytes.fromhex(txid)
|
if txns[0]['address'] == address_b58:
|
||||||
|
return bytes.fromhex(txid)
|
||||||
|
|
||||||
self._log.error('wallet {} balance {}, expected {}'.format(wallet_filename, rv['balance'], cb_swap_value))
|
self._log.error('wallet {} balance {}, expected {}'.format(wallet_filename, rv['balance'], cb_swap_value))
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ def addLockRefundSigs(self, xmr_swap, ci):
|
|||||||
|
|
||||||
|
|
||||||
def recoverNoScriptTxnWithKey(self, bid_id, encoded_key):
|
def recoverNoScriptTxnWithKey(self, bid_id, encoded_key):
|
||||||
# Manually recover txn if other key is known
|
self.log.info('Manually recovering %s', bid_id.hex())
|
||||||
|
# Manually recover txn if other key is known
|
||||||
session = scoped_session(self.session_factory)
|
session = scoped_session(self.session_factory)
|
||||||
try:
|
try:
|
||||||
bid, xmr_swap = self.getXmrBidFromSession(session, bid_id)
|
bid, xmr_swap = self.getXmrBidFromSession(session, bid_id)
|
||||||
|
@ -3,6 +3,13 @@
|
|||||||
==============
|
==============
|
||||||
|
|
||||||
|
|
||||||
|
0.0.30
|
||||||
|
==============
|
||||||
|
|
||||||
|
- Core launch log messages are written to disk.
|
||||||
|
- Fixed bug when manually redeeming noscript lock tx with invalid amount.
|
||||||
|
|
||||||
|
|
||||||
0.0.29
|
0.0.29
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user