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

lnpeer: dont remove from dont_settle_htlcs when failing

Public commit record

What the developer wrote

Authored by f321x

73/100 · Adequate
lnpeer: dont remove from dont_settle_htlcs when failing

Don't remove a payment hash from LNWallet.dont_settle_htlcs and
dont_expire_htlcs if we are failing it.
We might see another htlc with the same payment hash and
should still not settle or expire it.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change fixes a bug in Electrum's Lightning Network code. Previously, when the wallet decided to reject (fail) an incoming multi-part payment, it would remove the payment hash from two internal safety lists. Those lists are meant to prevent the wallet from prematurely settling or letting the payment expire while it is still waiting for all parts. Removing the hash during a failure could cause a later part of the same payment to be settled or expired incorrectly, potentially leading to loss of funds or routing problems. The patch simply stops removing the hash when failing.

Recommended action

Treat as a security-relevant bug fix and include in the next release. Users running Lightning nodes on affected versions should upgrade. Review related MPP failure paths for similar premature hash-removal patterns.

Security signals we found

01

Lightning Network HTLC state-management bug

02

Multi-part payment (MPP) race condition

03

Potential premature settlement/expiration of HTLCs

04

Funds-loss class bug in payment handling

Risk score

Why this scored 57/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 8/15
Confidence 6/10
Evidence quality 3/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.