From 6c000f9c90df5a61f96c4ffe65def4293136960b Mon Sep 17 00:00:00 2001 From: Doyle Date: Mon, 24 Aug 2020 16:06:51 +1000 Subject: [PATCH] service_nodes: Fix regression in RNG not using same seed --- src/cryptonote_core/service_node_list.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cryptonote_core/service_node_list.cpp b/src/cryptonote_core/service_node_list.cpp index 57c3d09ad..7880cf433 100644 --- a/src/cryptonote_core/service_node_list.cpp +++ b/src/cryptonote_core/service_node_list.cpp @@ -1443,8 +1443,9 @@ namespace service_nodes // reuse the same seed for both partial shuffles, but again, that isn't an issue. if ((0 < sublist_size && sublist_size < list_size) && (0 < sublist_up_to && sublist_up_to < list_size)) { assert(sublist_size <= sublist_up_to); // Can't select N random items from M items when M < N + auto rng_copy = rng; tools::shuffle_portable(result.begin(), result.begin() + sublist_up_to, rng); - tools::shuffle_portable(result.begin() + sublist_size, result.end(), rng); + tools::shuffle_portable(result.begin() + sublist_size, result.end(), rng_copy); } else { tools::shuffle_portable(result.begin(), result.end(), rng);