lnworker.has_anchor_channels: return False if channel is closed but not redeemed yet
What changed, and why it matters
This is a small bug fix in Electrum's Lightning wallet. Previously, the wallet treated anchor-type channels as still 'active' even after they were closed, as long as their funds hadn't been fully swept. This caused the wallet to incorrectly reserve extra on-chain funds (preventing the user from spending their full balance) until the channel's closing transaction was fully redeemed. The fix changes the check so a closed channel is no longer considered active, allowing the user to spend their maximum available balance sooner. It is a usability/funds-availability issue, not a theft or remote-exploitation vulnerability.
Treat as a routine bug fix rather than a security incident. Users who experienced unavailable balances after closing anchor Lightning channels should benefit after upgrading. No immediate incident-response action is indicated because the issue is self-DoS/funds-availability only and requires the user's own closed channel state.
Security signals we found
Logic error in channel-state guard condition
Funds-availability / DoS-on-own-funds effect (user cannot spend max balance)
No remote attacker control path evident from diff
Fix references a public user report on X (not a vendor security advisory)
Evidence from the diff
In electrum/lnworker.py, LNWallet.has_anchor_channels() previously returned True if any channel had anchor outputs and was not yet redeemed (not chan.is_redeemed()). Anchor channels require the wallet to keep a reserve of on-chain coins available to pay for potential force-close fees. Because the old condition ignored whether the channel was already closed, the wallet continued to reserve funds until the closing outputs were swept. The patch changes the condition to not chan.is_closed(), so closed anchor channels no longer trigger the reserve requirement. This resolves the reported symptom where ‘user cannot spend max until channel is redeemed.’
Changed components
electrum/lnworker.pyLNWallet.has_anchor_channels()Lightning anchor-channel reserve logicInspect captured patch +1 / −1
diff --git a/electrum/lnworker.py b/electrum/lnworker.py
index 0261e3f..8139e65 100644
--- a/electrum/lnworker.py
+++ b/electrum/lnworker.py
@@ -940,7 +940,7 @@ class LNWallet(LNWorker):
def has_anchor_channels(self) -> bool:
"""Returns True if any active channel is an anchor channel."""
- return any(chan.has_anchors() and not chan.is_redeemed()
+ return any(chan.has_anchors() and not chan.is_closed()
for chan in self.channels.values())
@property
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.