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

Don't double-forward inbounds resolved in holding cell

Public commit record

What the developer wrote

Authored by Valentine Wallace

73/100 · Adequate
Don't double-forward inbounds resolved in holding cell

We recently added support for reconstructing
ChannelManager::decode_update_add_htlcs on startup, using data present in the
Channels. However, we failed to prune HTLCs from this rebuilt map if a given
HTLC was already forwarded+removed from the outbound edge and resolved in the
inbound edge's holding cell.

Here we fix this bug that would have caused us to
double-forward inbound HTLC forwards, which fortunately was not shipped.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in the Lightning Dev Kit's rust-lightning implementation where, after restarting a forwarding node, an already-resolved inbound payment could be forwarded a second time. The bug occurred because the code rebuilt a list of pending payments from channel data on startup but did not exclude payments whose resolution was waiting in a temporary 'holding cell.' The fix filters out such payments so they are not double-forwarded. The commit message says the buggy code was never shipped in a release.

Recommended action

Review the fix for completeness (e.g., ensure all holding-cell resolution variants are covered and that no other pending-HTLC reconstruction paths have the same issue). Run the new regression test and consider backporting if the affected code exists in any shipped release, despite the commit message claiming it was not shipped.

Security signals we found

01

Double-forwarding of HTLCs after node restart

02

State-reconstruction bug during deserialization

03

Holding-cell resolution not pruned from pending HTLC set

04

Potential funds-at-risk / channel inconsistency if exploited

05

Regression test added for reload path

Risk score

Why this scored 56/100

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