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

Keep unsigned settlements when rejecting commands (#3401)

Public commit record

What the developer wrote

Authored by pm47

93/100 · Strong
Keep unsigned settlements when rejecting commands (#3401)

When a settlement command was rejected, we scheduled the deletion of the
pending settlement command stored in our DB for that HTLC. But it may have
been rejected because we had already proposed a settlement for that HTLC,
for example when receiving a duplicate of the same command: if that pending
settlement hadn't been signed yet, it would be lost if we disconnected before
signing it, since we wouldn't replay it on reconnection. For a relayed HTLC
that was fulfilled downstream, this could lead to the upstream HTLC timing
out instead of being fulfilled.

We now keep the pending settlement command in our DB in that case: it is
acknowledged once signed.

Reported-By: [project-loupe](https://github.com/project-loupe)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
✓ 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 Eclair, a Bitcoin Lightning Network node implementation. When the node received a duplicate command to settle a payment (fulfill or fail), it would mistakenly delete the still-pending settlement from its database. If the node disconnected before that settlement was signed, it would not be replayed on reconnection. For a payment being forwarded through the node, this could mean the downstream side got paid but the upstream side never received the proof it needed, causing the upstream payment to time out and potentially costing the node money. The fix keeps the pending settlement in the database until it has actually been signed.

Recommended action

Upgrade to a release containing this commit. Operators running routing nodes with relayed HTLCs should prioritize the update to avoid potential loss of funds from upstream HTLC timeouts. No immediate workaround is described; the fix is in the settlement acknowledgement logic.

Security signals we found

01

Loss of pending HTLC settlement state on disconnect/reconnect

02

Upstream HTLC timeout risk for relayed fulfilled downstream HTLCs

03

Duplicate/conflicting command handling caused premature DB acknowledgement

04

Fix adds explicit guard based on alreadyProposed local changes

05

Regression test covers duplicate CMD_FULFILL_HTLC and conflicting CMD_FAIL_HTLC

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.