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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user