Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "bnb: exit selection when best_waste is 0"
This reverts commit 9b5950d. Waste can be negative. At feerates lower than long_term_feerate this means that a waste of 0 may be a suboptimal solution and this causes the search to exit prematurely. Only when the feerate is equal to the long_term_feerate would achieving a waste of 0 indicate that we have achieved an optimal solution, because it would mean that the excess is 0. It seems unlikely that this would ever occur outside of test cases, and even then we should prefer solutions with more inputs over solutions with fewer according to previous decisions—but solutions with more inputs are found later in the branch exploration. The "optimization" described in bitcoin#18257 and implemented in bitcoin#18262 is therefore a premature exit on a suboptimal solution and should be reverted.
- Loading branch information