AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 49 Bitcoin

lnpeermgr: add_peer: fix check if proxy enabled

Public commit record

What the developer wrote

Authored by f321x

68/100 · Adequate
lnpeermgr: add_peer: fix check if proxy enabled

LNPeerManager.add_peer would only check if self.network.proxy is set,
which it is always as Network is initialized with self.proxy =
ProxySettings(). Instead it should check if proxy is set and enabled.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in Electrum's Lightning Network peer manager. Previously, the code thought a proxy was always configured because the proxy object always existed, even when disabled. As a result, it skipped DNS resolution and could behave incorrectly when connecting to peers, especially for .onion addresses which require a proxy. The fix checks whether the proxy is actually enabled, not just present.

Recommended action

Review is appropriate. The fix is small and targeted; ensure it is backported to supported branches and that the new regression tests pass. No immediate emergency response is indicated, but users relying on Lightning over Tor should verify proxy settings are correctly honored.

Security signals we found

01

Logic error in proxy-enabled check could cause DNS leak or incorrect routing behavior

02

Fix prevents skipping DNS resolution when proxy is disabled

03

Fix ensures .onion addresses are rejected when no proxy is actually enabled

04

Regression tests added for proxy-disabled and hostname resolution failure cases

Risk score

Why this scored 49/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 10/15
Affected reach 8/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.