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

Merge pull request #11551 from ziggie1984/public-pr149-sanitized

Public commit record

What the developer wrote

Authored by Yong

73/100 · Adequate
Merge pull request #11551 from ziggie1984/public-pr149-sanitized

invoices: revalidate accepted htlc expiries at set completion
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change fixes a bug in LND's invoice handling for multi-part payments (MPP and AMP). When a payment is split into several pieces (HTLCs), each piece is accepted individually. Previously, an old accepted piece could become too close to its expiry while waiting for the remaining pieces to arrive. Once the final piece arrived and completed the set, LND would settle all pieces without rechecking their expiries. This could let a piece be settled on-chain with too little time left, potentially causing funds loss if the on-chain claim fails to confirm in time. The fix revalidates every accepted piece's expiry at the moment the set completes, and cancels the whole set if any piece is now too close to expiry.

Recommended action

Treat this as a security-relevant bug fix and include it in the next maintenance release. Node operators accepting MPP/AMP payments should upgrade. Review whether any additional proactive expiry revalidation is needed while HTLCs are held before set completion.

Security signals we found

01

Fixes missing revalidation of accepted HTLC CLTV expiries at MPP/AMP set completion

02

Prevents settlement of shards whose on-chain claim window has become unsafe while held

03

Adds new fail resolution ResultHtlcSetExpiryTooSoon and cancels the entire affected set

04

Includes unit tests for MPP, AMP, replayed AMP HTLC near expiry, and RPC failure mapping

05

Refactors cancelHtlcSetUpdate helper to reuse set-cancellation logic

Risk score

Why this scored 64/100

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