diff --git a/basicswap/__init__.py b/basicswap/__init__.py index 943a286..e9cf488 100644 --- a/basicswap/__init__.py +++ b/basicswap/__init__.py @@ -1,3 +1,3 @@ name = "basicswap" -__version__ = "0.0.29" +__version__ = "0.0.30" diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 6e519b4..7d35ec6 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -3074,13 +3074,14 @@ class BasicSwap(BaseApp): 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) - block_header = ci_from.getBlockHeaderFromHeight(lock_refund_tx_chain_info['height']) - refund_tx.block_hash = bytes.fromhex(block_header['hash']) - refund_tx.block_height = block_header['height'] - refund_tx.block_time = block_header['time'] # Or median_time? + if lock_refund_tx_chain_info is not None: + block_header = ci_from.getBlockHeaderFromHeight(lock_refund_tx_chain_info['height']) + refund_tx.block_hash = bytes.fromhex(block_header['hash']) + 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) - session.commit() + self.saveBidInSession(bid_id, bid, session, xmr_swap) + session.commit() except Exception as ex: raise ex diff --git a/basicswap/interface_btc.py b/basicswap/interface_btc.py index a0bcc48..3aa73b4 100644 --- a/basicswap/interface_btc.py +++ b/basicswap/interface_btc.py @@ -975,6 +975,7 @@ class BTCInterface(CoinInterface): 'height': block_height} except Exception as e: + self._log.debug('getLockTxHeight gettransaction failed: %s, %s', txid.hex(), str(e)) return None if find_index: diff --git a/basicswap/interface_xmr.py b/basicswap/interface_xmr.py index 5269f20..1d699f5 100644 --- a/basicswap/interface_xmr.py +++ b/basicswap/interface_xmr.py @@ -406,13 +406,14 @@ class XMRInterface(CoinInterface): if rv['balance'] < cb_swap_value: self._log.warning('Balance is too low, checking for existing spend.') - txns = self.rpc_wallet_cb('get_transfers', {'out': True})['out'] - print(txns, txns) - if len(txns) > 0: - txid = txns[0]['txid'] - self._log.warning(f'spendBLockTx detected spending tx: {txid}.') - if txns[0]['address'] == address_b58: - return bytes.fromhex(txid) + txns = self.rpc_wallet_cb('get_transfers', {'out': True}) + if 'out' in txns: + txns = txns['out'] + if len(txns) > 0: + txid = txns[0]['txid'] + self._log.warning(f'spendBLockTx detected spending tx: {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)) diff --git a/basicswap/protocols/xmr_swap_1.py b/basicswap/protocols/xmr_swap_1.py index 0292dfd..49eff41 100644 --- a/basicswap/protocols/xmr_swap_1.py +++ b/basicswap/protocols/xmr_swap_1.py @@ -33,7 +33,8 @@ def addLockRefundSigs(self, xmr_swap, ci): 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) try: bid, xmr_swap = self.getXmrBidFromSession(session, bid_id) diff --git a/doc/release-notes.md b/doc/release-notes.md index 888c384..a55aa51 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -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 ==============