Skip to content

Running into TransactionNotFound errors during sync #494

@thomaseizinger

Description

@thomaseizinger

Describe the bug

In our application (https://github.com/itchysats/itchysats) we keep occasionally running into TransactionNotFound error's when syncing the wallet. Once we run into this problem, the wallet database is completely broken and needs to be deleted before things work again. We are using the SQLite database and the Electrum backend.

To Reproduce

Unfortunately, we don't quite know, how to reproduce the problem. The functionality of BDK that we are using is:

  • BIP84 descriptor
  • 2 parties create a PSBT and add inputs to fund a specific output
  • Both parties exchange the set of inputs with each other
  • Merge the PSBTs
  • Both parties sign their inputs
  • Exchange and merge the PSBTs
  • Finalize and broadcast the transaction

Recently, we've managed to reproduce this problem once where the above process aborted half-way through because the coin-selection failed with "InsufficientFunds" for one party.

Expected behavior

I am unsure what the best behaviour is but it is causing some headache that the DB is rendered unusable if you once run into this problem. It would be nice if the sync could still complete and only emit a warning that a certain transaction could not be processed.

I've read through the code a bit and checked where this error is returned but couldn't quite work out, how this is triggered by our use of BDK.

Build environment

  • BDK tag/commit: 0.14
  • OS+version: Linux 5.10.79-1-MANJARO
  • Rust/Cargo version: 1.57.0
  • Rust/Cargo target: x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions