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

invoices: cancel only the failing AMP set on reconstruction failure

Public commit record

What the developer wrote

Authored by Gijs van Dam

83/100 · Strong
invoices: cancel only the failing AMP set on reconstruction failure

When an AMP set completes but fails preimage reconstruction, updateMpp
issued a CancelInvoiceUpdate that canceled the greater invoice. For
reusable static AMP invoices this is too broad: the failure is a
set-local condition, since only the HTLCs of the failing set can never
settle. Other sets accepted on the same invoice are unaffected by the
failure and should remain payable.

Issue a CancelHTLCsUpdate scoped to the failing set instead, keeping
the invoice open. Adds a regression test verifying that a concurrently
accepted set on the same invoice survives a failing set and can still
settle.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in LND's invoice handling for reusable AMP (Atomic Multi-Path) invoices. Previously, if one payment set failed to reconstruct its preimage, the entire invoice was canceled, even though other valid payment sets on the same invoice were unaffected. Now, only the failing set is canceled, and the invoice stays open so other payers can still complete their payments. This is a correctness and availability fix for a specific Lightning Network payment feature.

Recommended action

Review and merge the patch; ensure CancelHTLCsUpdate correctly handles all edge cases for reusable AMP invoices and does not leave orphaned HTLCs in an unexpected state.

Security signals we found

01

Denial-of-service-like availability impact: a malicious or buggy payer could cause a whole reusable AMP invoice to be canceled, blocking legitimate concurrent payers

02

Set-local failure incorrectly escalated to invoice-global cancellation

03

Regression test added for concurrent-set survival after reconstruction failure

Risk score

Why this scored 60/100

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