refactor: make OutputGroup::m_outputs field a vector of shared_ptr

Initial steps towards sharing COutput instances across all possible
OutputGroups (instead of copying them time after time).
This commit is contained in:
furszy
2022-08-01 16:15:36 -03:00
parent d8e749bb84
commit 461f0821a2
7 changed files with 38 additions and 37 deletions

View File

@@ -30,7 +30,7 @@ static void GroupCoins(FuzzedDataProvider& fuzzed_data_provider, const std::vect
bool valid_outputgroup{false};
for (auto& coin : coins) {
if (!positive_only || (positive_only && coin.GetEffectiveValue() > 0)) {
output_group.Insert(coin, /*ancestors=*/0, /*descendants=*/0);
output_group.Insert(std::make_shared<COutput>(coin), /*ancestors=*/0, /*descendants=*/0);
}
// If positive_only was specified, nothing was inserted, leading to an empty output group
// that would be invalid for the BnB algorithm