Skip to content

Commit 08c1f34

Browse files
committed
Move change calculus to coin_select
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 isn't 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.
1 parent dd51380 commit 08c1f34

File tree

3 files changed

+220
-35
lines changed

3 files changed

+220
-35
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Fix hang when `ElectrumBlockchainConfig::stop_gap` is zero.
1111
- Set coin type in BIP44, BIP49, and BIP84 templates
1212
- Get block hash given a block height - A `get_block_hash` method is now defined on the `GetBlockHash` trait and implemented on every blockchain backend. This method expects a block height and returns the corresponding block hash.
13+
- Add `Excess` enum to handle remaining amount after coin selection.
14+
- Move change creation from `Wallet::create_tx` to `CoinSelectionAlgorithm::coin_select`.
1315

1416
## [v0.19.0] - [v0.18.0]
1517

0 commit comments

Comments
 (0)