diff options
author | yancy <yancy@yancy.lol> | 2022-09-16 14:22:42 +0200 |
---|---|---|
committer | yancy <yancy@yancy.lol> | 2022-09-16 14:29:05 +0200 |
commit | 365aca40453995163bbd17231251512f9f9a103b (patch) | |
tree | 635382a1c690e81fe7ffa77cd3daddeb0ee66d65 /src/wallet/coinselection.cpp | |
parent | ba2edcae7321d6f8dc4aad4acbbd2d3b5e846f5f (diff) | |
download | bitcoin-365aca40453995163bbd17231251512f9f9a103b.tar.xz |
refactor: Simplify feerate comparison statement
Diffstat (limited to 'src/wallet/coinselection.cpp')
-rw-r--r-- | src/wallet/coinselection.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp index b568e90998..718bced07d 100644 --- a/src/wallet/coinselection.cpp +++ b/src/wallet/coinselection.cpp @@ -93,7 +93,7 @@ std::optional<SelectionResult> SelectCoinsBnB(std::vector<OutputGroup>& utxo_poo bool backtrack = false; if (curr_value + curr_available_value < selection_target || // Cannot possibly reach target with the amount remaining in the curr_available_value. curr_value > selection_target + cost_of_change || // Selected value is out of range, go back and try other branch - (curr_waste > best_waste && (utxo_pool.at(0).fee - utxo_pool.at(0).long_term_fee) > 0)) { // Don't select things which we know will be more wasteful if the waste is increasing + (curr_waste > best_waste && (utxo_pool.at(0).fee > utxo_pool.at(0).long_term_fee))) { // Don't select things which we know will be more wasteful if the waste is increasing backtrack = true; } else if (curr_value >= selection_target) { // Selected value is within range curr_waste += (curr_value - selection_target); // This is the excess value which is added to the waste for the below comparison |