LLFourn / bdk_core_staging

Staging area for bdk_core initial development
15 stars 12 forks source link

Allow marking utxos as "spent" even when they're not #186

Open LLFourn opened 1 year ago

LLFourn commented 1 year ago

KeychainTracker should have mark_spent and unmark_spent that work in a similar way to mark_used and unmark_used in `KeychainTxOutIndex. The reason we want this is to be able to "reserve" utxos so other threads cannot use them when we've decide to construct a transaction using them.

See https://github.com/bitcoindevkit/bdk/issues/849 also

vladimirfomene commented 1 year ago

Let me look into this instead

vladimirfomene commented 1 year ago

HI @LLFourn! @evanlinjin was proposing that we add this feature as part of the transaction building logic given that we are going to do coins filtering/grouping already there. I personally don't know what is the best way to go about this. I wanted to check in with you and see what you think.

LLFourn commented 1 year ago

Transaction building is about choosing utxos that you want to use. Once you choose them you'll mark_spent them before finally broadcasting the transaction so other parts of the application don't try and use them I imagine. It seems like this API is useful in any context.