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

fix(corelightningrest): compute payment status fee as sent minus amount (#4300)

Public commit record

What the developer wrote

Authored by Amartya Vikram Singh

70/100 · Adequate
fix(corelightningrest): compute payment status fee as sent minus amount (#4300)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a bug in how LNbits calculates the fee for a completed Core Lightning REST payment. The old code incorrectly subtracted a negative 'amount sent' value, which produced the wrong fee. The fix changes the formula so the fee is simply the amount actually sent minus the original invoice amount. The test fixture was also updated to reflect that Core Lightning reports amount_sent_msat as a positive number, not negative.

Recommended action

Review whether any deployed instances using Core Lightning REST wallet reported incorrect fees, and verify that the corrected fee calculation matches Core Lightning's actual API output. No immediate emergency action is indicated, but the fix should be included in the next release.

Security signals we found

01

Incorrect arithmetic in financial/fee calculation

02

Test fixture updated to match corrected sign convention

03

Wallet backend payment status logic changed

Risk score

Why this scored 35/100

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