]> Untitled Git - bdk/commit
Move change calculus to coin_select
authorCesar Alvarez Vallero <46329881+csralvall@users.noreply.github.com>
Mon, 13 Jun 2022 13:49:31 +0000 (10:49 -0300)
committerCesar Alvarez Vallero <46329881+csralvall@users.noreply.github.com>
Sat, 23 Jul 2022 18:40:59 +0000 (15:40 -0300)
commit32ae95f463f62c42c6d6aec62c1832a30298fce4
treec0d831c4132fe8b590109f99edeafe09fb5e5be0
parent3644a452c16717c259c3d6c1b3aff7c9b636a800
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.
CHANGELOG.md
src/wallet/coin_selection.rs
src/wallet/mod.rs