What changed, and why it matters
This commit fixes a bug in Electrum's Lightning Network code where the wallet would incorrectly ignore routing hints for channels that are 'frozen' (temporarily blocked from sending). The bug only affected rebalancing payments where the user is both the sender and the receiver. The fix ensures frozen channels are only skipped when the routing hint truly starts at the user's own node, not when it merely passes through one of the user's channels later in the route. There is no direct evidence this is a security vulnerability; it appears to be a functional bug that could cause payment failures.
Treat as a routine bug fix. Users relying on Lightning rebalancing with frozen channels should update. No immediate security response is indicated by the commit content.
Security signals we found
Functional bug in Lightning route construction
Regression from prior change #9692
Condition incorrectly applied to all local channels rather than only edges originating at local node
No explicit security relevance stated by vendor
Evidence from the diff
In electrum/lnworker.py, create_route_for_single_htlc iterates over invoice routing hints (r_tags). A regression from #9692 caused the code to skip any r_tag edge whose short_channel_id matched one of the local channels if that channel was frozen for sending. However, this check was applied regardless of whether the local node was the start_node of that routing hint. In a rebalance scenario (us -> bob -> us), the final hop back to the user uses a frozen channel, and the code wrongly discarded the hint, making the route impossible to construct. The fix splits the assignment and adds the condition start_node == self.node_keypair.pubkey so the frozen-for-sending check only applies when the hint edge originates at the local node.
Changed components
electrum/lnworker.pyLNWallet.create_route_for_single_htlcLightning Network routing/r_tag handlingInspect captured patch +2 / −1
diff --git a/electrum/lnworker.py b/electrum/lnworker.py
index 245c1cd..8d1950d 100644
--- a/electrum/lnworker.py
+++ b/electrum/lnworker.py
@@ -2588,7 +2588,8 @@ class LNWallet(Logger):
for end_node, edge_rest in zip(private_path_nodes, private_path_rest):
short_channel_id, fee_base_msat, fee_proportional_millionths, cltv_delta = edge_rest
short_channel_id = ShortChannelID(short_channel_id)
- if (our_chan := self.get_channel_by_short_id(short_channel_id)) is not None:
+ our_chan = self.get_channel_by_short_id(short_channel_id)
+ if our_chan is not None and start_node == self.node_keypair.pubkey:
# check if the channel is one of our channels and frozen for sending
if our_chan.is_frozen_for_sending():
continue
Why this scored 22/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.