From 6ffaa55813438b94cb997d7dd0494e5572964884 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 19 Aug 2025 13:46:16 +0200 Subject: [PATCH] lnwatcher: early return in sweep_commitment_transaction if chan.need_to_subscribe returns False --- electrum/lnwatcher.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py index 126fb94f9..6a4842c09 100644 --- a/electrum/lnwatcher.py +++ b/electrum/lnwatcher.py @@ -153,6 +153,9 @@ class LNWatcher(Logger, EventListener): chan = self.lnworker.channel_by_txo(funding_outpoint) if not chan: return False + if not chan.need_to_subscribe(): + return False + self.logger.info(f'sweep_commitment_transaction {funding_outpoint}') # detect who closed and get information about how to claim outputs is_local_ctx, sweep_info_dict = chan.get_ctx_sweep_info(closing_tx) # note: we need to keep watching *at least* until the closing tx is deeply mined,