lightningd: bail out on splice if scid doesn't fit.
What changed, and why it matters
This change makes Core Lightning abort a 'splice' channel update if the resulting short channel ID (SCID) cannot be represented in the expected format. Previously the code ignored the failure return value and continued, which could leave the channel in an inconsistent or unrecoverable state. The patch is defensive and prevents a likely bug, but the commit message does not frame it as a security fix.
Treat as a hardening/reliability fix. Backport to maintained branches if splice is enabled, and add a regression test for the unrepresentable-SCID splice failure path. No immediate emergency response is indicated absent evidence of active exploitation.
Security signals we found
Unchecked return value now handled
State consistency fix during splice protocol
Potential channel corruption / DoS prevented
No explicit security framing by vendor
Evidence from the diff
In handle_peer_splice_locked(), depthcb_update_scid() returns a boolean indicating success. The original code ignored the return value and always proceeded to channel_watch_funding(). The patch checks the return value and returns early on failure. An unrepresentable SCID during splice lock would previously cause the function to continue with a bad SCID, potentially corrupting channel state or causing watchers to reference an invalid identifier.
Changed components
lightningd/channel_control.csplice locking pathshort channel ID (SCID) handlingInspect captured patch +3 / −1
diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c
index 1d623088..560d11b6 100644
--- a/lightningd/channel_control.c
+++ b/lightningd/channel_control.c
@@ -1187,7 +1187,9 @@ static void handle_peer_splice_locked(struct channel *channel, const u8 *msg)
loc = wallet_transaction_locate(tmpctx, channel->peer->ld->wallet,
&inflight->funding->outpoint.txid);
- depthcb_update_scid(channel, &inflight->funding->outpoint, loc);
+ /* Unrepresentable SCIDs cause channel failure */
+ if (!depthcb_update_scid(channel, &inflight->funding->outpoint, loc))
+ return;
/* That freed watchers in inflights: now watch funding tx */
channel_watch_funding(channel->peer->ld, channel);
Why this scored 42/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.