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

lnworker: fix _get_next_peers_to_try regression

Public commit record

What the developer wrote

Authored by f321x

80/100 · Strong
lnworker: fix _get_next_peers_to_try regression

`LNPeerManager._get_next_peers_to_try` would skip all recent peers
if no proxy is enabled due to incorrect operator precedence.
Fixes regression introduced by 79ef429b3.
✓ Descriptive subject✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a programming bug where the order of logical checks was wrong, causing Electrum to ignore all recently-used Lightning peers when no Tor proxy was configured. The fix makes the code correctly check whether the active proxy is a Tor proxy before deciding whether to skip onion-address peers. This is a connectivity bug rather than a direct theft or remote-code vulnerability, but it could make users' Lightning connections behave unexpectedly or prefer less optimal peers.

Recommended action

Treat as a routine bug fix. Users running Lightning on Electrum should update to a version containing this commit to restore correct peer selection, especially if they do not use a Tor proxy. No emergency response is warranted.

Security signals we found

01

Logic/precedence bug in peer-selection that could alter Lightning routing/connectivity behavior

02

Fix centralizes proxy/Tor checks on a single canonical property (is_proxy_tor), reducing future precedence mistakes

03

No direct cryptographic, authentication, or remote-code flaw visible in the diff

Risk score

Why this scored 25/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 5/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.