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

xpay: attempt amount could have different meanings

Public commit record

What the developer wrote

Authored by Lagrang3

73/100 · Adequate
xpay: attempt amount could have different meanings

Change the name of attempt->deliver to attempt->amount,
do not assume that amount is the "desired delivery", since it might be
the "desired send" depending on the payment context.

Use helpers to get the fees and deliver amount from an attempt.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a code-cleanup change in Core Lightning's experimental xpay plugin. The developer renamed a field and added helper functions so the code no longer confuses 'amount to deliver to the recipient' with 'amount we send into the network including fees'. The commit itself does not claim to fix a security bug, but it removes several places where the wrong meaning of 'amount' was being used, which could previously have led to incorrect fee calculations or payment accounting.

Recommended action

Treat as a hardening/refactoring patch with latent bug-fix potential. Review whether the pre-patch behavior could cause over-payment, under-delivery, or incorrect retry decisions in xpay. No immediate emergency action is indicated, but operators using xpay should update to a version containing this commit and monitor for related payment-failure or amount-mismatch issues.

Security signals we found

01

Semantic confusion between send amount and deliver amount in payment logic

02

Fee calculation previously subtracted deliver amount from first-hop amount, which is correct only if deliver amount equals final-hop amount

03

total_being_sent renamed to total_being_delivered and now uses final-hop amount_out, fixing aggregation of in-flight delivered value

04

Blinded-path and final-hop payloads now explicitly use computed deliver amount rather than raw attempt amount

Risk score

Why this scored 32/100

Our methodology →
Potential impact 8/30
Exploitability 5/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.