From 525e261520dc1989d6b766df12ccc9d69bd1643f Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 20 Mar 2025 10:07:41 +0100 Subject: [PATCH] lnworker: replace sometimes failing assert with print statement this assert typically fails when a channel is force-closed and the tx is unconfirmed --- electrum/lnworker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index dd8eabd4a..78ebbd962 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -1132,7 +1132,9 @@ class LNWallet(LNWorker): balance_msat = sum([x.amount_msat for x in out.values()]) lb = sum(chan.balance(LOCAL) if not chan.is_closed_or_closing() else 0 for chan in self.channels.values()) - assert balance_msat == lb + if balance_msat != lb: + # this typically happens when a channel is recently force closed + self.logger.info(f'get_lightning_history: balance mismatch {balnce_sat - lb}') return out def get_groups_for_onchain_history(self) -> Dict[str, str]: