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

lnpeer: deduct jit channel fees from total amount

Public commit record

What the developer wrote

Authored by f321x

76/100 · Adequate
lnpeer: deduct jit channel fees from total amount

Deduct the just in time channel opening fees from the total amount so
htlcs don't get timed out if they come from a just in time channel with
opening fee.

Related: https://github.com/spesmilo/electrum/pull/9584
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in Electrum's Lightning payment handling for 'just-in-time' (JIT) channels. When a payment arrives through a JIT channel, the channel opener charges an opening fee. Previously, the code did not properly subtract this fee when checking whether the full payment amount had been received. This could cause multi-part payments to time out or fail even though the sender had sent enough money, because the receiver's accounting compared the raw amount received against the invoice total without accounting for the fee already taken by the JIT channel. The patch renames the fee field for clarity and deducts the JIT opening fee from the total before deciding whether the payment is complete.

Recommended action

Treat this as a bug-fix patch with security-relevant availability impact. Users running Lightning nodes with JIT/zeroconf channels should upgrade. Review whether the fix is complete: the patch adds a TODO to validate that the fee is reasonable, which remains unimplemented and could represent a remaining economic-attack surface. Monitor for related follow-up commits.

Security signals we found

01

Logic error in payment amount accounting for JIT/zeroconf channel opening fees

02

Potential denial-of-service via premature MPP timeout of valid payments

03

Incomplete handling of channel_opening_fee TLV before patch

04

Field rename and type change to make fee handling explicit

Risk score

Why this scored 59/100

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