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
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user