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

invoices: reject settled AMP set shards

Public commit record

What the developer wrote

Authored by yyforyongyu

78/100 · Adequate
invoices: reject settled AMP set shards

Reject a fresh circuit for an already-settled AMP set through the normal
HTLC failure resolution. This avoids an updater error failing the shared
link and disturbing ordinary sibling payments.

Keep the reusable invoice open for distinct sets and verify that the
rejection changes neither stored shards nor paid value.
✓ 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 change fixes a bug in LND's invoice handling for AMP (Atomic Multi-Path) payments. Previously, if someone tried to pay a fresh shard for an AMP set that was already fully paid, the invoice updater could return an internal error that would fail the whole channel link, disrupting other normal payments traveling over the same link. Now, that fresh shard is rejected cleanly as a normal payment failure instead, keeping the channel link and other sibling payments undisturbed. The fix also ensures the already-paid set and accounting remain unchanged.

Recommended action

Reviewers should confirm that ResultInvoiceNotOpen is the correct failure code for this case and does not leak information or cause unintended behavior for the payer. Consider whether the same guard is needed in other invoice update entry points or for non-AMP MPP scenarios. The new test should be run in CI.

Security signals we found

01

Denial-of-service vector: an internal updater error could force-fail a shared channel link, disrupting unrelated sibling HTLCs

02

AMP invoice state machine edge case: reusable invoice stays open for other sets but must reject new shards for already-settled sets

03

Clean failure path introduced: ResultInvoiceNotOpen instead of error-driven link failure

04

Accounting integrity preserved: settled set, AmtPaid, SettleIndex, and HTLC map unchanged after rejection

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.