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

Add `AvailableBalances::next_splice_out_maximum_sat`

Public commit record

What the developer wrote

Authored by Leo Nash

63/100 · Adequate
Add `AvailableBalances::next_splice_out_maximum_sat`

We previously determined this value by subtracting the htlcs, the
anchors, and the commitment transaction fee. This ignored the reserve,
as well as the at-least-one-output requirement in zero-reserve channels.

This new field now accounts for both of these constraints. It can be
seen as the total spliceable balance from the channel.
✓ Specific, descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes how rust-lightning calculates the maximum amount a user can splice out of a Lightning channel. Previously the calculation ignored channel reserve rules and a requirement to keep at least one output, which could have allowed a user to request an invalid splice-out that the protocol or counterparty would reject. The new field properly accounts for both constraints, making splice-out operations safer and more likely to succeed.

Recommended action

Review the new `get_next_splice_out_maximum_sat` arithmetic and debug assertions for off-by-one errors, especially around the percentage reserve formula and the zero-reserve/minimum-output branches. Ensure test coverage includes zero-reserve channels and channels near the reserve boundary.

Security signals we found

01

Incorrect maximum splice-out calculation could lead to protocol-rejected or unbroadcastable splice transactions

02

Zero-reserve channel edge case could produce a commitment with no outputs

03

Reserve requirement was not recomputed after reducing channel value

04

New calculation includes post-splice reserve and at-least-one-output constraints

Risk score

Why this scored 46/100

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