Skip to content

Commit

Permalink
fix: resulting vector in GetProjectedMNPayees grows to the weighted c…
Browse files Browse the repository at this point in the history
…ount, should reserve memory accordingly
  • Loading branch information
UdjinM6 committed Oct 21, 2023
1 parent f49dc1e commit 3329fcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,11 @@ std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayees(int
isMNRewardReallocation = llmq::utils::IsMNRewardReallocationActive(pindex);
}

nCount = std::min(nCount, int(GetValidWeightedMNsCount()));
const auto weighted_count = GetValidWeightedMNsCount();
nCount = std::min(nCount, int(weighted_count));

std::vector<CDeterministicMNCPtr> result;
result.reserve(nCount);
result.reserve(weighted_count);

auto remaining_evo_payments = 0;
CDeterministicMNCPtr evo_to_be_skipped = nullptr;
Expand Down

0 comments on commit 3329fcf

Please sign in to comment.