From b7c20e71ac398a703d3c913b0637d31889898703 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 1 Jan 2018 18:03:00 -0500 Subject: [PATCH] Avoid modifying self.transactions in prepare_for_verifier In python3, the `.keys()` function returns an iterator, not a list, so to get a list that can be iterated over, use `list()` instead to avoid modification of a list while in use. --- lib/wallet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wallet.py b/lib/wallet.py index 9a319b193..65cdd3da6 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -959,7 +959,7 @@ class Abstract_Wallet(PrintError): # if we are on a pruning server, remove unverified transactions with self.lock: vr = list(self.verified_tx.keys()) + list(self.unverified_tx.keys()) - for tx_hash in self.transactions.keys(): + for tx_hash in list(self.transactions): if tx_hash not in vr: self.print_error("removing transaction", tx_hash) self.transactions.pop(tx_hash)