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

Merge PR 'Don't fail back holding-cell HTLCs on stale ChannelManager reload' (#5741)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Don't fail back holding-cell HTLCs on stale ChannelManager reload' (#5741)

from auto-pr-bot/bot/316-stale-channelmanager-reload-fail-ecdd82 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5741
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ 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 patch fixes a bug in the Lightning Dev Kit where reloading an older (stale) copy of the channel manager could incorrectly cancel payments that had actually already moved forward. In Lightning, the ChannelManager and ChannelMonitor are normally kept in sync. If a user accidentally restores an older ChannelManager while the ChannelMonitor is newer, the software force-closes the channel for safety and tries to 'fail backward' any payments it thinks were never sent. The bug was that this fail-backward step also included payments sitting in a temporary 'holding cell' queue. Those payments may have been released and sent to the next node after the older snapshot was taken, so cancelling them would wrongly take money from the user's own pocket or from routing nodes. The fix checks the newer ChannelMonitor: if it shows the payment was committed or even already claimed off-chain, the payment is left for the monitor to resolve instead of being cancelled.

Recommended action

Treat this as a security-relevant correctness fix and include it in the next maintenance release. Node operators who restore ChannelManager state from backups should upgrade before resuming operations. Review backup/restore documentation to warn against running an older ChannelManager against a newer ChannelMonitor.

Security signals we found

01

Incorrect HTLC fail-backward on stale ChannelManager reload

02

ChannelMonitor/ChannelManager state desynchronization edge case

03

Force-close safety path could harm user funds instead of protecting them

04

Holding-cell HTLCs incorrectly treated as never-committed

05

Off-chain claim events could be overridden by backwards failure

Risk score

Why this scored 66/100

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