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

Avoid force-closing 0-conf channels when funding is reorg'd

Public commit record

What the developer wrote

Authored by Matt Corallo

93/100 · Strong
Avoid force-closing 0-conf channels when funding is reorg'd

When we see a funding transaction for one of our chanels reorg'd
out, we worry that its possible we've been double-spent and
immediately force-close the channel to avoid accepting any more
HTLCs on it. This isn't ideal, but is mostly fine as most nodes
require 6 confirmations and 6 block reorgs are exceedingly rare.

However, this isn't so okay for 0-conf channels - in that case we
elected to trust the funder anyway, so reorgs shouldn't worry us.
Still, to handle this correctly we needed to track the old SCID and
ensure our logic is safe across an SCID change. Luckily, we did
that work for splices, and can now take advantage of it here.

Fixes #3836.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in rust-lightning where zero-confirmation (0-conf) Lightning channels were unnecessarily force-closed when their funding transaction was temporarily reorged out of the blockchain. For 0-conf channels, users already trust the funder, so a reorg should not trigger a force close. The fix tracks the old channel ID as a historical ID so payments can still flow, and only force-closes channels that required at least one confirmation. Regular 1+ confirmation channels still force-close on reorg, as before, to protect against double-spend risk.

Recommended action

Review the historical_scids pruning logic to ensure old SCIDs cannot be reused indefinitely, and confirm that channel announcement propagation delay bounds are appropriate. Monitor for any edge cases where a 0-conf channel's funding tx is double-spent rather than merely reorged.

Security signals we found

01

Avoids unnecessary force-closure of 0-conf channels on reorg

02

Tracks historical SCIDs to maintain payment routing continuity across reorg

03

Preserves force-close behavior for 1+ confirmation channels to mitigate double-spend risk

04

Adds regression tests for 0-conf reorg handling

05

Changes error message string for unconfirmed funding closure

Risk score

Why this scored 55/100

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