1
0

wallet.is_up_to_date: fix flickering during sync due to race

AddressSynchronizer.add_address called synchronizer.add, which would only
schedule adding the addr to the Synchronizer in the next event loop iter.
If during that time, the synchronizer called adb.set_up_to_date(True),
the wallet would falsely believe and advertise itself as up_to_date
(as the wallet would see wallet.synchronize not creating new addresses,
and adb (via synchronizer) telling it is up_to_date).
Moments later, the synchronizer._add_address is finally executed and
up_to_date=False propagates out synchronizer->adb->wallet.
This commit is contained in:
SomberNight
2022-12-20 13:58:02 +00:00
parent d821e26f6e
commit dc6c481406
3 changed files with 14 additions and 12 deletions

View File

@@ -212,7 +212,7 @@ class AddressSynchronizer(Logger, EventListener):
self.db.history[address] = []
self.set_up_to_date(False)
if self.synchronizer:
self.synchronizer.add(address)
self.synchronizer.add_address(address)
def get_conflicting_transactions(self, tx_hash, tx: Transaction, include_self=False):
"""Returns a set of transaction hashes from the wallet history that are