From 93738e715940ca642d449a77f676cc39d388e67e Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 8 Jul 2025 13:31:15 +0000 Subject: [PATCH] lnwatcher: maybe_add_pending_forceclose: also check SRK channels ref https://github.com/spesmilo/electrum/pull/9798#discussion_r2172090792 and clarify "was_added" parameter --- electrum/lnwatcher.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py index 8b55b27e8..ca269809d 100644 --- a/electrum/lnwatcher.py +++ b/electrum/lnwatcher.py @@ -190,7 +190,12 @@ class LNWatcher(Logger, EventListener): else: keep_watching |= was_added self.maybe_add_pending_forceclose( - chan=chan, spender_txid=spender_txid, is_local_ctx=is_local_ctx, sweep_info=sweep_info, was_added=was_added) + chan=chan, + spender_txid=spender_txid, + is_local_ctx=is_local_ctx, + sweep_info=sweep_info, + sweep_info_txo_is_nondust=was_added, + ) return keep_watching def get_pending_force_closes(self): @@ -251,10 +256,10 @@ class LNWatcher(Logger, EventListener): spender_txid: Optional[str], is_local_ctx: bool, sweep_info: 'SweepInfo', - was_added: bool, + sweep_info_txo_is_nondust: bool, # i.e. we want to sweep it ): """ we are waiting for ctx to be confirmed and there are received htlcs """ - if was_added and is_local_ctx and sweep_info.name == 'received-htlc' and chan.has_anchors(): + if is_local_ctx and sweep_info.name == 'received-htlc' and sweep_info_txo_is_nondust: tx_mined_status = self.adb.get_tx_height(spender_txid) if tx_mined_status.height == TX_HEIGHT_LOCAL: self._pending_force_closes.add(chan)