diff --git a/electrum/commands.py b/electrum/commands.py index c72c63b6f..30a4c9b04 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -1077,7 +1077,8 @@ class Commands(Logger): arg:int:year:Show history for a given year """ # trigger lnwatcher callbacks for their side effects: setting labels and accounting_addresses - await wallet.lnworker.lnwatcher.trigger_callbacks(requires_synchronizer=False) + if not self.network and wallet.lnworker: + await wallet.lnworker.lnwatcher.trigger_callbacks(requires_synchronizer=False) #'from_height': (None, "Only show transactions that confirmed after given block height"), #'to_height': (None, "Only show transactions that confirmed before given block height"), diff --git a/electrum/daemon.py b/electrum/daemon.py index 434dd7092..86425d50b 100644 --- a/electrum/daemon.py +++ b/electrum/daemon.py @@ -470,7 +470,12 @@ class Daemon(Logger): if wallet := self._wallets.get(wallet_key): return wallet wallet = self._load_wallet(path, password, upgrade=upgrade, config=self.config) - wallet.start_network(self.network) + if self.network: + wallet.start_network(self.network) + elif wallet.lnworker: + # in offline mode, we need to trigger callbacks + coro = wallet.lnworker.lnwatcher.trigger_callbacks(requires_synchronizer=False) + asyncio.run_coroutine_threadsafe(coro, self.asyncio_loop) self.add_wallet(wallet) self.update_recently_opened_wallets(path) return wallet