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
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user