Introduce a Shuffle for FastRandomContext and use it in wallet and coinselection

This commit is contained in:
Pieter Wuille
2018-10-31 15:42:03 -07:00
parent 8098379be5
commit 3db746beb4
4 changed files with 60 additions and 3 deletions

View File

@@ -223,7 +223,7 @@ bool KnapsackSolver(const CAmount& nTargetValue, std::vector<OutputGroup>& group
std::vector<OutputGroup> applicable_groups;
CAmount nTotalLower = 0;
random_shuffle(groups.begin(), groups.end(), GetRandInt);
Shuffle(groups.begin(), groups.end(), FastRandomContext());
for (const OutputGroup& group : groups) {
if (group.m_value == nTargetValue) {