Skip to content

[bug]: channel open transaction fails to broadcast because lnd is unaware of own mempool transaction after rescan #7300

@antonilol

Description

@antonilol

Background

2 issues, but one is caused by the other

  • when a channel is opened and the transaction fails to broadcast, lnd will keep the channel in the pending channels, but it can know it wont ever confirm
  • when a wallet is restored, the mempool is not scanned

Your environment

  • version of lnd: lnd version 0.15.99-beta commit=tlv/v1.1.0-104-gef8cf73d4 (today's master)
  • which operating system (uname -a on *Nix) archlinux
  • version of btcd, bitcoind, or other backend bitcoin core v24.0.1
  • any other relevant environment details

Steps to reproduce

  1. create a new wallet
  2. send coins to it
  3. wait for 1 confirmation
  4. spend the coins (at 1 sat/vB)
  5. delete the wallet
  6. restore the wallet
  7. if the spend of step 4 confirmed start over
  8. open a channel (at 1 sat/vB)

Expected behaviour

mempool is scanned after restore, the spending transaction is seen in the mempool and lnd will not try to reuse it
if for some reason a channel open fails, lnd should handle the error

Actual behaviour

lnd tried to open a channel with a utxo that was already spent in the mempool and did not provide enough fee for rbf, and thus got rejected by bitcoind

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2should be fixed if one has timebugUnintended code behaviourmempoolrecoveryRelated to the backup/restoration of LND data (e.g. wallet seeds)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions