diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-08-02 11:54:20 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2023-03-06 09:45:40 -0300 |
commit | bd91ed1cb2cc804f824d1b204513ac2afb7d5e28 (patch) | |
tree | 9956b147f73c622e5f895337fb27c1c3a0098613 /src/wallet/test/coinselector_tests.cpp | |
parent | 55962001da4f8467e52da502b05f5c0a85128fb0 (diff) |
wallet: unify outputs grouping process
The 'GroupOutputs()' function performs the same
calculations for only-positive and mixed groups,
the only difference is that when we look for
only-positive groups, we discard negative utxos.
So, instead of wasting resources calling GroupOutputs()
for positive-only first, then call it again to include
the negative ones in the result, we can execute
GroupOutputs() only once, including in the response
both group types (positive-only and mixed).
Diffstat (limited to 'src/wallet/test/coinselector_tests.cpp')
-rw-r--r-- | src/wallet/test/coinselector_tests.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp index 4f6b3a5e4f..841d762932 100644 --- a/src/wallet/test/coinselector_tests.cpp +++ b/src/wallet/test/coinselector_tests.cpp @@ -153,9 +153,9 @@ inline std::vector<OutputGroup>& KnapsackGroupOutputs(const CoinsResult& availab /*tx_noinputs_size=*/ 0, /*avoid_partial=*/ false, }; - static std::vector<OutputGroup> static_groups; - static_groups = GroupOutputs(wallet, available_coins.All(), coin_selection_params, filter, /*positive_only=*/false); - return static_groups; + static OutputGroupTypeMap static_groups; + static_groups = GroupOutputs(wallet, available_coins, coin_selection_params, {filter}); + return static_groups.all_groups.mixed_group; } // Branch and bound coin selection tests |