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

lightningd: fail in-flight HTLCs upstream when dropping withheld channel

Public commit record

What the developer wrote

Authored by Peter Neuroth

85/100 · Strong
lightningd: fail in-flight HTLCs upstream when dropping withheld channel

When a withheld channel is force-closed (e.g. due to CLTV timeout),
in-flight HTLCs were being freed without failing them back to the
upstream sender. This caused the upstream peer to eventually
force-close its own channel waiting for a resolution that would
never come.

Iterate over all offered HTLCs on the withheld channel in
drop_to_chain() and fail them back upstream with
permanent_channel_failure before freeing them.

Changelog-fixed: withheld channel now fail back incoming inflight htlc
✓ 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 fixes a bug in Core Lightning where money-transfer promises (HTLCs) stuck in a special 'withheld' channel were silently dropped when that channel was force-closed. Previously, the upstream sender was never told the payment failed, so it would eventually force-close its own channel waiting for a resolution that would never arrive. The patch now explicitly fails those HTLCs back upstream before freeing them, preventing unnecessary channel force-closures and fund lockups.

Recommended action

Apply the patch. Operators running nodes that accept zeroconf/withheld channels should upgrade to avoid unnecessary upstream force-closures and fund lockups. Review any historical force-closures that coincided with withheld channel timeouts to assess whether they were triggered by this bug.

Security signals we found

01

Denial-of-service via forced channel closure: missing HTLC failure caused upstream peers to force-close channels unnecessarily

02

Funds lockup risk: unresolved HTLCs could leave funds locked until cooperative close or further on-chain resolution

03

State inconsistency: HTLCs freed locally without upstream failure notification

04

Fix pattern: explicit fail-back of all in-flight offered HTLCs before channel cleanup

Risk score

Why this scored 60/100

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