From: Alekos Filini Date: Tue, 26 Jul 2022 09:50:45 +0000 (+0200) Subject: Merge bitcoindevkit/bdk#630: Move change logic to coin_select X-Git-Tag: v0.21.0~14 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/enum.FileStoreError.html?a=commitdiff_plain;h=6bae52e6f2843a371ec2a6e293ea7ab0ba96aff4;p=bdk Merge bitcoindevkit/bdk#630: Move change logic to coin_select 32ae95f463f62c42c6d6aec62c1832a30298fce4 Move change calculus to coin_select (Cesar Alvarez Vallero) Pull request description: ### Description The former way to compute and create change was inside `create_tx`, just after performing coin selection. It blocked the opportunity to have an "ensemble" algorithm to decide between multiple coin selection algorithms based on a metric, like Waste. Now, change is not created inside `coin_select` but the change amount and the possibility to create change is decided inside the `coin_select` method. In this way, change is associated with the coin selection algorithm that generated it, and a method to decide between them can be implemented. Fixes #147. ### 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: * [ ] I've added tests for the new feature * [x] I've added docs for the new feature * [x] I've updated `CHANGELOG.md` ACKs for top commit: afilini: ACK 32ae95f463f62c42c6d6aec62c1832a30298fce4 Tree-SHA512: 350adb86538949ff50f41151fc46c8d28d9f5fd659e9869882cc3cb30128d76d4b479512c74c721f8beebfdb5423363ad63368e30556efe65ced2b8c52c34ef6 --- 6bae52e6f2843a371ec2a6e293ea7ab0ba96aff4