bitcoindevkit / bdk

A modern, lightweight, descriptor-based wallet library written in Rust!
Other
846 stars 307 forks source link

Calling `example_electrum sync` on an unconfirmed tx may result in the tx being stuck as unconfirmed eternally (according to the cli)) #1125

Closed evanlinjin closed 1 month ago

evanlinjin commented 1 year ago

Describe the bug
Calling example_electrum sync on an unconfirmed tx may result in the tx being stuck as unconfirmed eternally (according to the cli)).

To Reproduce

  1. Send a transaction: example_electrum send 123456 <insert-address-here>.
  2. Perform example_electrum sync until the transaction is confirmed (according to the block explorer).
  3. Do example_electrum balance -> You'll see that the transaction is not confirmed (according to our cli).
  4. Do example_electrum scan && example_electrum balance -> The transaction is still NOT confirmed!

The transaction is forever stuck as unconfirmed according to our cli.

Expected behavior

That the tx is viewed as confirmed by our cli.

evanlinjin commented 1 year ago

New discovery: The cli saw it as confirmed after I called scan after one additional confirmation.

danielabrozzoni commented 10 months ago

Re-opening as #1145 didn't fix this

evanlinjin commented 7 months ago

May be fixed by this: https://github.com/bitcoindevkit/bdk/issues/1354

notmandatory commented 3 months ago

Move to beta milestone to re-test.

evanlinjin commented 2 months ago

Because bdk_electrum has already been re-architectured so that chain updates and anchor updates are fetched orthogonal to each other, I don't think this bug can occur any longer...

However let's have tests to make sure previously unconfirmed transactions get confirmed again in both reorg and no-reorg situations.

LagginTimes commented 2 months ago

I'll take a look at this.