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

Fix: For inner trampoline onions amt_to_forward can be larger than the htlc amount

Public commit record

What the developer wrote

Authored by f321x

100/100 · Strong
Fix: For inner trampoline onions amt_to_forward can be larger than the htlc amount

Add unittest to TestPeerForwarding which sends a multi trampoline
payment.

Wait another htlc_switch iteration in tests because trampolines might have different delays
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in Electrum's Lightning Network code where multi-trampoline payments could incorrectly fail. In normal payments, the amount specified inside the onion must match the HTLC amount. But for trampoline routing, an inner trampoline onion can legitimately request a larger amount than the current HTLC because the payment is split across multiple trampoline forwarders. The old code enforced the strict match check even for these inner trampoline onions, causing valid payments to be rejected with a 'final incorrect HTLC amount' error. The fix moves the check into a method that only applies to final (non-trampoline-forwarding) HTLCs and skips it for inner trampoline onions.

Recommended action

Reviewers should verify that skipping the amount check is limited strictly to inner trampoline onions and cannot be triggered by a final recipient, confirm that total_msat and payment_secret validation still prevent overpayment abuse, and consider whether additional test coverage for edge cases (e.g., maliciously inflated inner trampoline amounts) is warranted.

Security signals we found

01

Logic bug in payment validation causing denial-of-service for legitimate multi-trampoline payments

02

Validation check applied too broadly to inner trampoline onions

03

Fix includes regression test for multi-trampoline MPP scenario

Risk score

Why this scored 61/100

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