Skip to content

Rebroadcast channel funding transactions until they confirm (peer-broadcast fundings invisible today) #9776

Backlog

Description

@cdecker

Problem

When a channel's funding transaction falls out of the mempool (eviction, conflicting
replacement, a reorg, or the funder never actually broadcast it), the channel sits in
CHANNELD_AWAITING_LOCKIN forever: nothing ever rebroadcasts the funding tx. For
dual-open / zero-conf channels this is worse when the peer is the funder — e.g. an LSP
that abandons a funding after an offer fee changes — the node cannot even answer "was our
funding tx ever broadcast?", so a silently dropped funding looks identical to a slow
mempool.

This is Greenlight's tracking issue for the operator-visible symptom:
lightning/greenlight#973
("Catch funding transactions so funding visibility is locally checkable").

Prior art

Proposal

Once #9697's invariant holds (every channel funding tx has a transactions row with
rawtx from first sight, and a persisted visibility state):

  1. For channels awaiting lockin, periodically rebroadcast the recorded funding tx (after
    Guarantee a full channel transaction history: record funding txs from block scans and from the mempool #9697's own visibility tracking flips to "never seen" re-query rather than spam).
  2. Surface the state so callers/operators can distinguish "never broadcast" / "in
    mempool" / "confirmed" — e.g. in listpeerchannels/listfunds via the Guarantee a full channel transaction history: record funding txs from block scans and from the mempool #9697 enum.
  3. Consider a policy knob for zero-conf channels whose funding remains unconfirmed past a
    threshold (warn; optionally treat like a failed open for forgetting purposes).

Reopening/absorbing #3590 rather than duplicating it is fine — the difference since 2020
is that #9697 makes the fix implementable.

Activity

  1. ksedgwic commented on Nov 27, 2026

    @ksedgwic
    Collaborator

    Related open reports, each with a failing test: #9112 (funder side, test in #9113) and #9102 (mutual close completed before the funding confirmed, test in #9103).
    After a close attempt such a channel is in AWAITING_UNILATERAL or CLOSINGD_COMPLETE, not CHANNELD_AWAITING_LOCKIN, so those states need the same handling. The channels in both reports are still in these states today, the oldest since 2025-10.

    Rebroadcast needs an end condition: some funding transactions can never confirm.
    In #9112 bitcoind rejected the funding tx at the first broadcast (min relay fee not met), and all of its inputs have since been spent by other transactions.

    Suggested end condition: a funding input is spent by a conflicting transaction that is buried to a reorg-safe depth (the tests use 100 blocks).
    A timeout alone is not safe: while the inputs are unspent the funding tx can still confirm. Once the conflicting spend is buried, the funding output can never exist and the channel can be forgotten. The tests in #9113 and #9103 assert both parts.

    Existing code: since v25.12 lightningd re-sends unconfirmed funding transactions once at startup (resend_opening_transactions), for channels with a stored funding PSBT.

    Peer-funded channels: the fundee forget rule (2016 blocks) keeps the newest 100 channels it could forget, so a node with fewer than 100 forgets none.
    The channels in #9102 meet the rule's conditions and are still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions