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