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

Drop `total_msat` from individual `ClaimableHTLC`s

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Drop `total_msat` from individual `ClaimableHTLC`s

Now that we have `total_mpp_amount_msat` in the now-required
`RecipientOnionFields` in `ClaimablePayment`s, the `total_msat`
field in `ClaimableHTLC` is redundant. Given it was already
awkward that we stored it in *each` `ClaimableHTLC` despite it
being required to match in all of them, its good to drop 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 removes a redundant copy of the expected total payment amount from each individual HTLC record in LDK's channel manager. The expected total is now stored once per payment in the required 'RecipientOnionFields' structure. The change also tightens serialization/deserialization checks so that all HTLCs in a multi-part payment must agree on the total amount. It appears to be a code-cleanup and hardening change rather than a fix for an active vulnerability, though it removes a potential source of inconsistency that could have led to incorrect payment handling.

Recommended action

Treat as a defensive refactor. Review that all MPP code paths now consistently use `payment.onion_fields.total_mpp_amount_msat` and that no logic still relies on a per-HTLC total. Validate backward compatibility with older persisted state, since the TLV field is still written and read. No urgent patch is indicated unless further review reveals a behavioral bug.

Security signals we found

01

Removes duplicated authoritative value (total_msat) that previously had to match across all HTLCs

02

Adds deserialization check rejecting inconsistent total_mpp_amount_msat across HTLCs of the same payment

03

Changes MPP completion condition from per-HTLC total_msat to per-payment onion_fields.total_mpp_amount_msat

04

Removes runtime consistency check between individual HTLC total_msat fields, moving validation to load time

05

Serialization compatibility preserved by still writing total_msat in TLV slot 1 and reading it back

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 6/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.