Skip to content

[bug]: failed funding broadcast doesn't remove pending channels and unlock UTXOs #7868

@Roasbeef

Description

@Roasbeef

Background

If we fail a broadcast, we don't do anything, and the channel just sits there. This still occupies the locked UTXOs, and also the pending channel entry in the database:

lnd/funding/manager.go

Lines 2448 to 2463 in 03b26bb

err = f.cfg.PublishTransaction(fundingTx, label)
if err != nil {
log.Errorf("Unable to broadcast funding tx %x for "+
"ChannelPoint(%v): %v", fundingTxBuf.Bytes(),
completeChan.FundingOutpoint, err)
// We failed to broadcast the funding transaction, but
// watch the channel regardless, in case the
// transaction made it to the network. We will retry
// broadcast at startup.
//
// TODO(halseth): retry more often? Handle with CPFP?
// Just delete from the DB?
}
}

Steps to reproduce

Double spend a UTXO in a funding transaction.

Expected behaviour

UTXO unlocked, and pending channel cleared.

Actual behaviour

UTXOs still locked, channel shows up in lncli pendingchannels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1MUST be fixed or reviewedbugUnintended code behaviourfundingRelated to the opening of new channels with funding transactions on the blockchainutxo sweeping

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions