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

Make PriorContribution::holder_balance non-optional

Public commit record

What the developer wrote

Authored by Wilmer Paulino

85/100 · Strong
Make PriorContribution::holder_balance non-optional

The `holder_balance` is computed by
`FundedChannel::get_holder_counterparty_balances_floor_incl_fee`, which
may unexpectedly fail due to the balance either being too high or too
low. These cases are highly unlikely to happen given we have validation
to ensure we never enter such a state to begin with. If they were to
happen, something has gone wrong with the channel and it doesn't make
sense to allow splicing anyway. Therefore, we opt to make
`PriorContribution::holder_balance` non-optional and return an error
that the channel cannot be spliced at the moment.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit tightens error handling during Bitcoin Lightning channel splicing. Previously, if the software could not compute the user's current channel balance, it would silently skip a fee-rate optimization and re-run coin selection. Now it treats that balance-computation failure as a hard error and refuses to splice. This prevents the code from proceeding with potentially incorrect fee calculations when the channel is in an unexpected state, but it is a defensive hardening change rather than a fix for a known exploitable bug.

Recommended action

Treat as a defensive hardening commit. Reviewers should verify that get_holder_counterparty_balances_floor_incl_fee can only fail in genuinely inconsistent channel states and that returning ChannelUnavailable does not introduce a denial-of-service vector for legitimate splice operations. No immediate security response is indicated absent additional context.

Security signals we found

01

Defensive hardening: converts silent fallback to explicit error

02

Removes Option wrapper around balance used in fee-rate adjustment

03

Propagates balance-computation failure as APIError::ChannelUnavailable

04

Prevents proceeding with splicing when channel state is inconsistent

05

No explicit CVE, advisory, or security disclosure referenced

Risk score

Why this scored 29/100

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