1
0

wallet: fire fewer 'status' and 'wallet_updated' triggers

Especially during initial history sync, there are a lot of False->False up_to_date transitions
(e.g. adb.add_address generates one), and the GUI does some work for each, which adds up to a lot
of CPU usage for the full sync.
This commit is contained in:
SomberNight
2022-12-23 09:35:29 +00:00
parent 0037053d73
commit 61f2654f31

View File

@@ -465,8 +465,9 @@ class Abstract_Wallet(ABC, Logger, EventListener):
self.adb.reset_netrequest_counters() # sync progress indicator
self.save_db()
# fire triggers
util.trigger_callback('wallet_updated', self)
util.trigger_callback('status')
if status_changed or up_to_date: # suppress False->False transition, as it is spammy
util.trigger_callback('wallet_updated', self)
util.trigger_callback('status')
if status_changed:
self.logger.info(f'set_up_to_date: {up_to_date}')