Skip to content

Commit e9b51ef

Browse files
committed
Consolidate fee_amount and amount_needed
Before this commit `fee_amount` and `amount_needed` were passed as independent parameters. From the perspective of coin selection algorithms, they are always used jointly for the same purpose, to create a coin selection with a total effective value greater than it's summed values. This commit removes the abstraction that the use of the two parameter introduced by consolidating both into a single parameter, `target_amount`, who carries their values added up.
1 parent 8e0d00a commit e9b51ef

File tree

3 files changed

+103
-128
lines changed

3 files changed

+103
-128
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
- Add `Excess` enum to handle remaining amount after coin selection.
1010
- Move change creation from `Wallet::create_tx` to `CoinSelectionAlgorithm::coin_select`.
1111
- Change the interface of `SqliteDatabase::new` to accept any type that implement AsRef<Path>
12+
- Consolidate params `fee_amount` and `amount_needed` in `target_amount` in `CoinSelectionAlgorithm::coin_select` signature.
13+
- Change the meaning of the `fee_amount` field inside `CoinSelectionResult`: from now on the `fee_amount` will represent only the fees asociated with the utxos in the `selected` field of `CoinSelectionResult`.
1214

1315
## [v0.20.0] - [v0.19.0]
1416

0 commit comments

Comments
 (0)