Browse Source

wallet: is_up_to_date() to return False if taskgroup stopped

If the taskgroup died unexpectedly, this will result in the GUI
showing we are in the "synchronizing" state instead of the green orb.
Being stuck in "synchronizing" provides at least *some* feedback to
the user that something is wrong.

see https://github.com/spesmilo/electrum/issues/8301
master
SomberNight 3 years ago
parent
commit
488dc4871e
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 3
      electrum/wallet.py

3
electrum/wallet.py

@ -373,6 +373,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
except Exception as e:
self.logger.exception("taskgroup died.")
finally:
util.trigger_callback('wallet_updated', self)
self.logger.info("taskgroup stopped.")
async def do_synchronize_loop(self):
@ -460,6 +461,8 @@ class Abstract_Wallet(ABC, Logger, EventListener):
self.save_db()
def is_up_to_date(self) -> bool:
if self.taskgroup.joined: # either stop() was called, or the taskgroup died
return False
return self._up_to_date
def tx_is_related(self, tx):

Loading…
Cancel
Save