Browse Source

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.
master
SomberNight 3 years ago
parent
commit
61f2654f31
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/wallet.py

1
electrum/wallet.py

@ -465,6 +465,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
self.adb.reset_netrequest_counters() # sync progress indicator
self.save_db()
# fire triggers
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:

Loading…
Cancel
Save