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

sweep: retry inconclusive spend checks

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

68/100 · Adequate
sweep: retry inconclusive spend checks

In this commit, we distinguish a failed spend lookup from a completed
lookup that found no spender.

Notifier registration and closed-subscription errors no longer crash the
node or get treated as "not spent" by accident. When the missing input
path can't tell whether an input was spent, it now returns a retryable
result instead of a fatal one, and the sweeper keeps the input's existing
starting fee preference rather than replacing it with the result's zero
value.

During regular record processing, an inconclusive check is logged and
the record proceeds as if no input was spent. Skipping it instead would
stop fee bumps for a deadline sweep for as long as the check keeps
failing. If an input was in fact spent, the mempool rejects the attempt
for missing inputs and the missing input handling takes over.
✓ 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 LND's transaction sweeping logic. Previously, when the node couldn't reliably check whether an input had already been spent (for example, because a notifier registration failed or a subscription closed unexpectedly), the code could either crash the node or wrongly treat the input as unspent. The patch makes these failures retryable instead of fatal, preserves the user's chosen fee rate instead of resetting it to zero, and continues fee-bumping deadline sweeps even when the spend check is inconclusive. This prevents stuck funds or incorrect fee handling during network or backend hiccups.

Recommended action

Treat this as a defensive hardening fix and include it in the next maintenance release. Operators running nodes that experience backend notifier instability should prioritize upgrading. No immediate emergency response is indicated because the issue is primarily a reliability/DoS concern rather than a remote exploit.

Security signals we found

01

Previously inconclusive spend checks could be treated as 'not spent', potentially leading to invalid transaction publication or missed spend detection

02

Notifier registration failures previously logged `Criticalf` and returned `nil`, risking node crash or unsafe fallback behavior

03

Closed spend subscriptions were silently ignored, allowing false 'unspent' classification

04

Retryable failure path now preserves existing fee preference, avoiding zero-fee follow-up sweeps

05

Deadline sweeps continue fee-bumping despite backend uncertainty, reducing risk of HTLC timeout failures

Risk score

Why this scored 57/100

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