Skip to content

Commit 6e8744d

Browse files
committed
Merge #557: add OldestFirstCoinSelection
6931d0b add private function select_sorted_utxso to be resued by multiple CoinSelection impl (KaFai Choi) 545beec add OldestFirstCoinSelection (KaFai Choi) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### Description This PR is to add `OldestFirstCoinSelection`. See this issue for detail #120 <!-- Describe the purpose of this PR, what's being adding and/or fixed --> ### Notes to the reviewers Apologize in advance if the quality of this PR is too low.(I am newbie in both bitcoin wallet and rust). While this PR seemed very straight-forward to me in the first glance, it's actually a bit more complicated than I thought as it involves calling DB get the blockheight before sorting it. The current implementation should be pretty naive but I would like to get some opinion to see if I am heading to a right direction first before working on optimizations like ~~1. Avoiding calling DB for optional_utxos if if the amount from required_utxos are already enough.~~ Probably not worth to do such optimization to keep code simpler? ### 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 added docs for the new feature * [x] I've updated `CHANGELOG.md` #### Bugfixes: * [ ] This pull request breaks the existing API * [ ] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR ACKs for top commit: afilini: ACK 6931d0b Tree-SHA512: d297bbad847d99cfdd8c6b1450c3777c5d55bc51c7934f287975c4d114a21840d428a75a172bfb7eacbac95413535452b644cab971efb8c0b5caf0d06d6d8356
2 parents 79f73df + 6931d0b commit 6e8744d

File tree

2 files changed

+316
-35
lines changed

2 files changed

+316
-35
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
- added `OldestFirstCoinSelection` impl to `CoinSelectionAlgorithm`
910

1011

1112
## [v0.18.0] - [v0.17.0]

0 commit comments

Comments
 (0)