diff options
author | glozow <gloriajzhao@gmail.com> | 2022-03-11 12:20:36 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2022-03-11 12:22:34 +0000 |
commit | ec7d73628a6397fca3b5b852d4e97ff918b6d3a6 (patch) | |
tree | 2a71a2352f8b29cfa94eeb154e852033bd73488a /src/wallet/spend.cpp | |
parent | ce1fabe5454dfd01fe95b4a948704fcd3a155859 (diff) |
[wallet] assert BnB internally calculated waste is the same as GetSelectionWaste()
These two implementations of waste calculation should never deviate.
Still keep the SelectCoinsBnB internal calculation because incremental
calculate-as-you-go is much more performant than calling
GetSelectionWaste() over and over again.
Diffstat (limited to 'src/wallet/spend.cpp')
-rw-r--r-- | src/wallet/spend.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 83eaececc1..582464c5b8 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -379,7 +379,6 @@ std::optional<SelectionResult> AttemptSelection(const CWallet& wallet, const CAm // Note that unlike KnapsackSolver, we do not include the fee for creating a change output as BnB will not create a change output. std::vector<OutputGroup> positive_groups = GroupOutputs(wallet, coins, coin_selection_params, eligibility_filter, true /* positive_only */); if (auto bnb_result{SelectCoinsBnB(positive_groups, nTargetValue, coin_selection_params.m_cost_of_change)}) { - bnb_result->ComputeAndSetWaste(CAmount(0)); results.push_back(*bnb_result); } |