From 5a7b68b39b7ee65a7ef844d42ae67f0dd961d40d Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 13 May 2022 16:52:58 +0100 Subject: [PATCH] Track txs which are unconf at process startup Before this commit, if Joinmarket-Qt or any other long running script was started when a new utxo had been created in the wallet, but was not yet in a block, the transition from unconfirmed to confirmed state would not be registered, because when confirmation happened and the event was seen in the transaction monitor, that txid was not in the active_txs dict. This is now fixed. --- jmclient/jmclient/wallet_service.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jmclient/jmclient/wallet_service.py b/jmclient/jmclient/wallet_service.py index 19a6037..55ba6b2 100644 --- a/jmclient/jmclient/wallet_service.py +++ b/jmclient/jmclient/wallet_service.py @@ -860,6 +860,14 @@ class WalletService(Service): script = hextobin(utxo['scriptPubKey']) value = int(Decimal(str(utxo['amount'])) * Decimal('1e8')) self.add_utxo(txid, int(utxo['vout']), script, value, height) + # if we start up with unconfirmed outputs, they must be + # put into the transaction monitor state, so we can recognize + # when they transition to confirmed. + if height is None: + txd = self.bci.get_deser_from_gettransaction( + self.bci.get_transaction(txid)) + self.active_txs[utxo['txid']] = txd + self.processed_txids.add(utxo['txid']) """ The following functions mostly are not pure