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

Correct error types for outbound splice checking methods

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Correct error types for outbound splice checking methods

When doing an outbound splice, we check some of the instructions
first in utility methods, then convert errors to `APIError`s. These
utility methods should thus either return an `APIError` or more
generic (string or `()`) error type, but they currently return a
`ChannelError`, which is only approprite when the calling code will
do what the `ChannelError` instructs (including closing the
channel).

Here we fix that by returning `String`s instead.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This patch fixes a bug in how error types are used during Bitcoin Lightning channel 'splicing' operations. Splicing lets users add or remove funds from an open channel. Two internal helper functions were returning a 'ChannelError' type, which tells the caller to take specific actions such as warning or closing the channel. But the callers actually convert the result into a normal API error and do not follow those instructions. As a result, a splice that should simply fail with a clear message could instead be misinterpreted as a reason to close the channel or send a protocol warning. The fix changes the helpers to return plain text error strings instead, so the correct failure behavior happens.

Recommended action

Review callers of these helpers to confirm all error paths now produce sensible APIError variants and that no remaining ChannelError values are converted without honoring their action semantics. Consider adding regression tests that verify the exact APIError returned to users for insufficient splice inputs.

Security signals we found

01

Incorrect error-type semantics in channel state machine

02

Risk of unintended channel close or protocol warning due to ChannelError misuse

03

Outbound splice input validation helper returns error that may be converted to APIError

04

No explicit security advisory or CVE referenced in commit

Risk score

Why this scored 34/100

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