mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 01:35:20 +00:00
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.
This commit is contained in:
parent
7ae1a4cdeb
commit
0a83b3af22
1 changed files with 1 additions and 1 deletions
|
@ -969,7 +969,7 @@ class Abstract_Wallet(PrintError):
|
||||||
# if we are on a pruning server, remove unverified transactions
|
# if we are on a pruning server, remove unverified transactions
|
||||||
with self.lock:
|
with self.lock:
|
||||||
vr = list(self.verified_tx.keys()) + list(self.unverified_tx.keys())
|
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:
|
if tx_hash not in vr:
|
||||||
self.print_error("removing transaction", tx_hash)
|
self.print_error("removing transaction", tx_hash)
|
||||||
self.transactions.pop(tx_hash)
|
self.transactions.pop(tx_hash)
|
||||||
|
|
Loading…
Add table
Reference in a new issue