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

lightningd: don't try to re-xmit funding tx for already-confirmed channels.

Public commit record

What the developer wrote

Authored by enaples

73/100 · Adequate
lightningd: don't try to re-xmit funding tx for already-confirmed channels.

`resend_opening_transactions` runs at startup before `begin_topology()`, so `channel->depth` is still 0 (its DB-load default) for every channel.
The `depth != 0` guard was therefore a no-op, and we issued a `sendrawtransaction` for every committed channel on every restart. For long-confirmed channels bitcoind replies with error `-27` ("Transaction outputs already in utxo set"), surfacing as an `UNUSUAL` log on every startup.

Gate on channel state instead: only the three states where the funding or splice tx can still be unconfirmed
(`CHANNELD_AWAITING_LOCKIN`, DUALOPEND_AWAITING_LOCKIN`, `CHANNELD_AWAITING_SPLICE`) qualify for rebroadcast.

Changelog-Fixed: lightningd: don't spuriously try to re-broadcast funding txs of already-confirmed channels on startup.
✓ 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 harmless but noisy bug in Core Lightning. On every restart, the node was trying to re-broadcast the funding transaction for channels that were already confirmed long ago. Bitcoin rejected these with a routine 'already known' error, which just cluttered the logs. The fix changes the startup check so re-broadcast only happens for channels that are actually still waiting for their first confirmation.

Recommended action

No urgent action required. This is a log-noise/operational fix. Operators can upgrade at their normal cadence; the bug does not expose funds or allow remote exploitation.

Security signals we found

01

Spurious re-broadcast of funding transactions on node restart

02

Reliance on a field (channel->depth) that is uninitialized at the point of use

03

Routine bitcoind error -27 ('Transaction outputs already in utxo set') surfaced as UNUSUAL log

04

No loss of funds or consensus failure; issue is operational/log noise

Risk score

Why this scored 25/100

Our methodology →
Potential impact 4/30
Exploitability 0/25
Stealth signal 3/15
Affected reach 5/15
Confidence 9/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.