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

Correct channel closed detection in payment state replay

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Correct channel closed detection in payment state replay

While the case of not having a per-peer-state for a peer that we
have a `ChannelMonitor` with should be unreachable by this point in
`ChannelManager` loading (we have to at least store the latest
update id of the monitor in the peer state), considering a channel
as still-live and not replaying its payment state when we don't
have a per-peer-state is wrong, so here we fix it.
✓ 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 logic bug in the Lightning Dev Kit's channel manager. During startup, when the software replays the state of pending payments, it now assumes a channel is closed unless it finds live peer state proving otherwise. Previously it assumed the channel was open unless proven closed. The change prevents a situation where payments tied to a channel with no peer state would be treated as still active and never re-failed or re-claimed, potentially leaving funds stuck.

Recommended action

Review whether the missing-peer-state scenario can actually occur in production (e.g., after crashes, partial persistence, or data corruption) and add regression tests. Monitor for any reports of stuck pending payments or channels not being replayed on startup. Consider this for inclusion in a bug-fix release.

Security signals we found

01

Logic inversion in payment replay path

02

Potential stuck pending payments if peer state is missing

03

Funds availability / liveness issue in channel state recovery

04

No explicit security framing by vendor

Risk score

Why this scored 55/100

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