From d05e7a17e11da0ba90bcc16025ce257491424953 Mon Sep 17 00:00:00 2001 From: chris-belcher Date: Mon, 2 Dec 2019 13:38:43 +0000 Subject: [PATCH] Fix bug where listtransactions result omits txid Account movement transactions are deprecated in Core but they still sometimes appear in old wallets. Such transactions create an entry in the listtransactions result which doesnt have a "txid" key. --- jmclient/jmclient/wallet_service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jmclient/jmclient/wallet_service.py b/jmclient/jmclient/wallet_service.py index 313b30e..0c0d6e3 100644 --- a/jmclient/jmclient/wallet_service.py +++ b/jmclient/jmclient/wallet_service.py @@ -187,10 +187,12 @@ class WalletService(Service): # process either (a) a completely new tx or # (b) a tx that reached unconf status but we are still # waiting for conf (active_txids) + if "txid" not in x: + continue if x['txid'] in self.active_txids or x['txid'] not in self.old_txs: new_txs.append(x) # reset for next polling event: - self.old_txs = [x['txid'] for x in txlist] + self.old_txs = [x['txid'] for x in txlist if "txid" in x] for tx in new_txs: txid = tx["txid"] @@ -329,7 +331,8 @@ class WalletService(Service): self.sync_unspent() # Don't attempt updates on transactions that existed # before startup - self.old_txs = [x['txid'] for x in self.bci.list_transactions(100)] + self.old_txs = [x['txid'] for x in self.bci.list_transactions(100) + if "txid" in x] return self.synced def resync_wallet(self, fast=True):