Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

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

Open
LLFourn opened this issue Feb 12, 2023 · 3 comments
Open

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

LLFourn opened this issue Feb 12, 2023 · 3 comments

Comments

@LLFourn
Copy link
Owner

LLFourn commented Feb 12, 2023

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 bitcoindevkit/bdk#849 also

@vladimirfomene
Copy link
Contributor

Let me look into this instead

@vladimirfomene
Copy link
Contributor

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
Copy link
Owner Author

LLFourn commented Feb 24, 2023

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.

vladimirfomene added a commit to vladimirfomene/bdk_core_staging that referenced this issue Feb 25, 2023
This PR solves LLFourn#186.It add functionality
to mark UTXOs as selected/reserved once
they have been selected by a transaction
during the transaction building process.
Therefore the wallet cannot choose this
reserved UTXOs for subsequent transaction
building.
vladimirfomene added a commit to vladimirfomene/bdk_core_staging that referenced this issue Feb 26, 2023
This PR solves LLFourn#186.It add functionality
to mark UTXOs as selected/reserved once
they have been selected by a transaction
during the transaction building process.
Therefore the wallet cannot choose this
reserved UTXOs for subsequent transaction
building.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants