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

Fix edge case in `availableBalanceForSend/Receive` (#3308)

Public commit record

What the developer wrote

Authored by Bastien Teinturier

91/100 · Strong
Fix edge case in `availableBalanceForSend/Receive` (#3308)

There was a small discrepancy between `availableBalanceForSend/Receive`
and `canSendAdd/canReceiveAdd` when the sender is not paying the commit
tx fees. In `canSendAdd/canReceiveAdd`, we verify that the receiver
(who pays the commit fees) can still pay those fees after adding the
new HTLC to the commit tx. In `availableBalanceForSend/Receive`, we did
not verify that.

This only happens in very rare cases where the receiver is paying the
commit fees and is very close this its channel reserve, so it should
rarely happen in practice, but it sometimes makes our fuzz tests fail.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This patch fixes a mismatch in how Eclair calculates how much Bitcoin can be sent or received through a Lightning channel. Previously, the balance estimate could say a payment was possible, but the actual safety check would later reject it because the other party couldn't afford the on-chain transaction fees. This could cause payment attempts to fail unexpectedly, especially in edge cases where one side is nearly out of funds. It is a consistency bug rather than a direct theft-of-funds vulnerability.

Recommended action

Apply the patch. It is a low-risk correctness fix. After deployment, monitor for any unexpected zero-balance reports on channels where the fee-paying peer is close to its reserve, and verify that fuzz tests no longer fail on this edge case.

Security signals we found

01

Logic inconsistency between balance reporting and commitment validation

02

Missing fee-reserve check in non-initiator fee path

03

Potential for failed HTLC adds despite positive reported balance

04

Fuzz-test failures triggered the fix

Risk score

Why this scored 36/100

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