Skip to content

panic (assertion) in try_filter_chain_txouts #1898

@stevenroose

Description

@stevenroose

Describe the bug
I'm hitting this assertion in the tx_graph.rs try_filter_chain_txouts method:

                    assert!(
                        _res.is_none(),
                        "tried to replace {:?} with {:?}",
                        _res,
                        txid
                    );

Is this because one of the txs I made is being double spent?
We are not doing the most innocent bitcoin txs, but we're not doing any weird fiddling with bdk either. Just make a tx and then it gets double spent away on chain. And then the sync procedure panics with this message.

I'm not sure I understand what's going on here or in that method during sync. But it sounds like bdk will crash your program if sync is called while one of your transcations is double spent on-chain or in mempool?

To Reproduce
Not sure it's easy to reproduce. I created a tx that didn't pass mempool checks, and then another tx onchain double spent that tx.

Expected behavior
Sync shouldn't panic if no broken bdk functions were called?

Build environment

  • BDK tag/commit: branch based on 0a20724, but assert also present in master
  • OS+version: nixos
  • Rust/Cargo version: 1.84.0
  • Rust/Cargo target: linux

Additional context
n/a

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions