Skip to content

Fix failed to retransmit funding tx#9147

Open
enaples wants to merge 2 commits into
ElementsProject:masterfrom
enaples:test-failed-to-retransmit-funding-tx
Open

Fix failed to retransmit funding tx#9147
enaples wants to merge 2 commits into
ElementsProject:masterfrom
enaples:test-failed-to-retransmit-funding-tx

Conversation

@enaples
Copy link
Copy Markdown
Collaborator

@enaples enaples commented May 19, 2026

Important

26.06 FREEZE April 30th: Non-bugfix PRs not ready by this date will wait for 26.09.

RC1 is scheduled on May 14th

The final release is scheduled for June 1st.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

Fix issue #9091
Changelog-Fixed: lightningd: don't spuriously try to re-broadcast funding txs of already-confirmed channels on startup.

enaples added 2 commits May 19, 2026 14:17
`resend_opening_transactions` gated on `channel->depth != 0`, but depth is reset to 0 when channels are loaded from the DB and only repopulated `after begin_topology()` runs. So at startup every channel matched and `bitcoind` rejected the rebroadcast with error `-27` ("Transaction outputs already in utxo set"), facing as an `UNUSUAL` log.

Changelog-Fixed: lightningd: don't spuriously try to re-broadcast funding txs of already-confirmed channels on startup.
…nnels.

`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.
@enaples enaples force-pushed the test-failed-to-retransmit-funding-tx branch from 6261b55 to 3c2cf6e Compare May 19, 2026 12:19
@enaples enaples changed the title Test failed to retransmit funding tx Fix failed to retransmit funding tx May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stuck transaction: "UNUSUAL Failed to re-transmit funding tx: error code: -27\nerror message:\nTransaction outputs already in utxo set\n"

1 participant