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

Fix the HTLC failure reason reported when a peer is offline

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Fix the HTLC failure reason reported when a peer is offline

If a peer is offline, but only recently went offline and thus the
channel has not yet been marked disabled in our gossip, we should
be returning `LocalHTLCFailureReason::PeerOffline` rather than
`LocalHTLCFailureReason::ChannelNotReady`. Here we fix the error
returned and tweak documentation to make the cases clearer.
✓ Specific, 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 small but meaningful error-code bug in the Lightning Dev Kit. When a payment is being routed through a node whose peer just went offline (but the network gossip hasn't yet marked the channel as disabled), the node was incorrectly reporting 'channel not ready' instead of 'peer offline'. The fix makes the reported failure reason accurate, which helps other nodes and payment senders understand why a route failed and choose better routes.

Recommended action

Treat as a routine correctness/security-hardening patch. Reviewers should verify that no other failure paths conflate disconnection, disabled channels, and not-ready channels, and consider whether any tests cover the newly distinguished PeerOffline case.

Security signals we found

01

Incorrect error reporting could mislead routing/payment logic

02

Fixes a logic branch in HTLC failure handling

03

Documentation updated to clarify security-relevant failure semantics

Risk score

Why this scored 33/100

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