From d733350ac53c2eccbc0b95943d8083788ffbd7e8 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 25 Feb 2026 18:48:04 +0000 Subject: [PATCH] lnwatcher: ~document behaviour re subbing to historical chans and swaps not so intuitive ref https://github.com/spesmilo/electrum/pull/7852 ("Persist lnwatcher") --- electrum/lnwatcher.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py index 4db9b04e8..75ae63307 100644 --- a/electrum/lnwatcher.py +++ b/electrum/lnwatcher.py @@ -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