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

lightningd: tidy dualopen_errmsg's forget-channel paths

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

81/100 · Strong
lightningd: tidy dualopen_errmsg's forget-channel paths

The places we forget an in-progress open now go through
forget_channel_open(), which quotes BOLT #2 and won't delete once
we've sent tx_signatures. Merged the duplicated BOLT #1 error quote
while we were here.

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 8e6dfad5de657c1e778e7ee22f6a213da75ec022)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change refactors how Core Lightning cleans up unfinished channel openings when something goes wrong mid-negotiation. It funnels all 'forget this channel' paths through one helper that refuses to delete the channel once the node has already sent its transaction signatures. Before, the same safety check was repeated in several spots, which made it easier to accidentally skip it in future changes. The patch is a defensive hardening fix rather than a clear-cut vulnerability repair, but it directly enforces a protocol rule meant to prevent funds from being lost or stuck.

Recommended action

Treat as a low-to-moderate hardening patch. Review whether any other code paths outside dualopen_errmsg delete an in-progress dual-funding channel without using forget_channel_open(), and consider adding regression tests that simulate error/disconnect after tx_signatures are sent to confirm the channel is retained.

Security signals we found

01

Centralizes a safety invariant (do not delete channel after tx_signatures sent) into a single helper

02

Directly quotes and enforces BOLT #2 protocol requirement

03

Removes duplicated guards that could drift or be bypassed in future edits

04

Targets dual-funding channel open error handling, a sensitive state machine

05

No explicit bug or CVE described in commit message

Risk score

Why this scored 42/100

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