1
0

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:
SomberNight
2023-04-13 14:42:06 +00:00
parent 8774e59347
commit 488dc4871e

View File

@@ -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):