1
0

lnwatcher: catch callback exceptions

Catch exceptions happening to callbacks to continue calling the
remaining callbacks. Otherwise if the first callback throws an exception
the remaining callbacks aren't going to be called.
This commit is contained in:
f321x
2025-09-08 13:37:27 +02:00
parent 8abe4a1dd4
commit 23f158291c

View File

@@ -56,7 +56,10 @@ class LNWatcher(Logger, EventListener):
self.logger.info("synchronizer not set yet")
return
for address, callback in list(self.callbacks.items()):
await callback()
try:
await callback()
except Exception:
self.logger.exception(f"LNWatcher callback failed {address=}")
# send callback to GUI
util.trigger_callback('wallet_updated', self.lnworker.wallet)