Skip to content

TxBuilder continously tries to spend missing output, Wallet unable to spend any funds #202

@tnull

Description

@tnull

Describe the bug
We got a report of a user's user whose LDK Node instance is unable to spend any on-chain funds due to the TxBuilder always trying to spend an output that's absent from the chain. Hence, the wallet receives a sendrawtransaction RPC error: {\"code\":-25,\"message\":\"bad-txns-inputs-missingorspent\"} error when trying to broadcast the resulting transaction.

The wallet is synced against an Esplora backend, and indeed syncs via EsploraExt::sync/Wallet::apply_update are finishing successfully, but the wallet doesn't seem to be picking up on the missing output. They also tried forcing a full_scan, which unfortunately didn't result in any improvement.

To Reproduce
I don't know what happened, but one theory would be that there was a reorg and the wallet somehow didn't handle it correctly.

Expected behavior
The wallet picking up that the transaction is absent from the chain, and TxBuilder not trying to spend it.

Build environment

  • LDK Node 0.4.2, which depends on:
bdk_chain = { version = "=0.19.0", default-features = false, features = ["std"] }
bdk_esplora = { version = "=0.18.0", default-features = false, features = ["async-https-rustls"]}
bdk_wallet = { version = "=1.0.0-beta.4", default-features = false, features = ["std", "keys-bip39"]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions