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

Rebuild pending payments list before replaying pending claims/fails

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Rebuild pending payments list before replaying pending claims/fails

On `ChannelManager` reload we rebuild the pending outbound payments
list by looking for any missing payments in `ChannelMonitor`s.
However, in the same loop over `ChannelMonitor`s, we also re-claim
any pending payments which we see we have a payment preimage for.

If we send an MPP payment across different chanels, the result may
be that we'll iterate the loop, and in each iteration add a
pending payment with only one known path, then claim/fail it and
remove the pending apyment (at least for the claim case). This may
result in spurious extra events, or even both a `PaymentFailed` and
`PaymentSent` event on startup for the same payment.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This patch fixes a startup bug in the Lightning Dev Kit's channel manager. When the software restarts, it scans past payment data to rebuild its list of pending payments and to finalize any that already have a result. Previously, these two steps were mixed together in one loop, which could cause a multi-path payment to be partially rebuilt and then finalized before all paths were seen. This could produce duplicate or contradictory events, such as reporting the same payment as both failed and sent. The fix separates the work into two loops: first rebuild all pending payments, then finalize them. There is no direct security exploit here, but the inconsistent state could confuse downstream software or users.

Recommended action

Apply the patch. After upgrade, monitor for any anomalous duplicate PaymentSent/PaymentFailed events during node restart, and ensure downstream event consumers handle idempotently. No immediate incident response is indicated because the issue is a local state-replay bug, not an externally exploitable vulnerability.

Security signals we found

01

State inconsistency on reload leading to duplicate/conflicting payment events

02

Multi-path payment (MPP) handling edge case

03

No input validation or memory-safety issue visible in diff

Risk score

Why this scored 34/100

Our methodology →
Potential impact 12/30
Exploitability 0/25
Stealth signal 3/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.