From: Alekos Filini Date: Mon, 14 Mar 2022 15:06:16 +0000 (+0100) Subject: Merge bitcoindevkit/bdk#515: Never delete spent utxos from the database X-Git-Tag: v0.18.0~17 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/%22example_cli/enum.Commands.html/enum.FromSliceError.html?a=commitdiff_plain;h=9a6db15d265fb0811b010ce13eebb3a316479d99;p=bdk Merge bitcoindevkit/bdk#515: Never delete spent utxos from the database f2f0efc0b3367abf40e33b84fc577fb11f625b04 Never delete spent utxos from the database (Daniela Brozzoni) Pull request description: ### Description A `is_spent` field is added to LocalUtxo; when a txo is spent we set this field to true instead of deleting the entire utxo from the database. This allows us to create txs double-spending txs already in blockchain. Listunspent won't return spent in mempool utxos, effectively excluding them from the coin selection and balance calculation Fixes #414 ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [x] I've added tests for the new feature * [x] I've updated `CHANGELOG.md` * [x] I'm linking the issue being fixed by this PR ACKs for top commit: afilini: Re-ACK f2f0efc Tree-SHA512: 7984b69c56b3b12746c2301072d637dea1346730aa132f1ea67c5bd8bf685bd557fc7cbdc2fc1185e63c71db07d36cd979514921b2c83c55737cd4b96102377e --- 9a6db15d265fb0811b010ce13eebb3a316479d99