lnwatcher: ~document behaviour re subbing to historical chans and swaps

not so intuitive

ref https://github.com/spesmilo/electrum/pull/7852 ("Persist lnwatcher")
This commit is contained in:
SomberNight
2026-02-25 18:48:04 +00:00
parent 2c9f4fdbae
commit d733350ac5
+6
View File
@@ -48,6 +48,12 @@ class LNWatcher(Logger, EventListener):
subscribe: bool = True,
) -> None:
if subscribe:
# FIXME even when called with subscribe=False, adb likely already has this address.
# wallet.adb==lnwatcher.adb, and adb.db==wallet.db, which is persisted to disk.
# A call to adb.add_address at any time will add the address to the persistent DB.
# So in practice adb has the channel-related and swap-related addresses we *ever*
# subscribed to, and will have adb.synchronizer sub to them again.
# (even for old redeemed channels and old swaps)
self.adb.add_address(address)
self.callbacks[address] = callback