From 488dc4871e3d10f5a59bc0b4a9e727f4df26a34c Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 13 Apr 2023 14:42:06 +0000 Subject: [PATCH] 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 --- electrum/wallet.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/wallet.py b/electrum/wallet.py index 94d9fe8fa..6b217c027 100644 --- a/electrum/wallet.py +++ b/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):