mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
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).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user