p2pderivatives / rust-bitcoin-coin-selection

10 stars 5 forks source link

Do not return when waste is zero because waste could be negative #14

Closed yancyribbens closed 1 year ago

yancyribbens commented 1 year ago

To keep pace with changes in Bitcoin Core, this PR removes the condition that returns early if a result with a waste of zero is found. The matching Bitcoin Core PR is here.

The other reason why I want to implement this change is so that we can get an accurate benchmark comparison between this implementation and Bitcoin Core. This change essentially makes every search an exhaustive search of the search space since there is no known optimal solution to halt on.

murchandamus commented 1 year ago

I just had a look at this change. I have the impression that the implementation here seems to optimize for the smallest sum of UTXO values at least meeting the target, not at the best waste score.