Browse Source

synchronizer: request missing txs for addresses in random order

as discussed in issue #6697, users with large wallets or slow
connections may never see their initial request-missing-tx run complete,
if we always use the same sync order.

This commit shuffles the addresses being requested every time a new
request round happens, so that (if enough time passes and enough initial
state requests are attempted) we will always get the latest state for
each address, regardless of how quickly the connection times out on us
patch-4
ln2max 4 years ago
committed by SomberNight
parent
commit
7fdedd5c40
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/synchronizer.py

2
electrum/synchronizer.py

@ -232,7 +232,7 @@ class Synchronizer(SynchronizerBase):
async def main(self):
self.wallet.set_up_to_date(False)
# request missing txns, if any
for addr in self.wallet.db.get_history():
for addr in random_shuffled_copy(self.wallet.db.get_history()):
history = self.wallet.db.get_addr_history(addr)
# Old electrum servers returned ['*'] when all history for the address
# was pruned. This no longer happens but may remain in old wallets.

Loading…
Cancel
Save