mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
wallet: single output groups filtering and grouping process
Optimizes coin selection by performing the "group outputs" procedure only once, outside the "attempt selection" process. Avoiding the repeated execution of the 'GroupOutputs' operation that occurs on each coin eligibility filters (up to 8 of them); then for every coin vector type plus one for all the coins together. This also let us not perform coin selection over coin eligibility filtered groups that don't add new elements. (because, if the previous round failed, and the subsequent one has the same coins, then this new round will fail again).
This commit is contained in:
@@ -154,7 +154,7 @@ inline std::vector<OutputGroup>& KnapsackGroupOutputs(const CoinsResult& availab
|
||||
/*avoid_partial=*/ false,
|
||||
};
|
||||
static OutputGroupTypeMap static_groups;
|
||||
static_groups = GroupOutputs(wallet, available_coins, coin_selection_params, {filter});
|
||||
static_groups = GroupOutputs(wallet, available_coins, coin_selection_params, {{filter}})[filter];
|
||||
return static_groups.all_groups.mixed_group;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user