aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-08-19 17:31:39 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-08-19 17:31:39 -0500
commitf205d28e96ef86303475a57b3fea15d2ede8a752 (patch)
tree441fdb1de85bd9eaf60b65fbfbfe3019957bb224 /src
parentMerge pull request #5725 (diff)
parentReplace std::random_shuffle with std::shuffle (diff)
downloadmonero-f205d28e96ef86303475a57b3fea15d2ede8a752.tar.xz
Merge pull request #5727
7b9a420 Replace std::random_shuffle with std::shuffle (tomsmeding)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_tx_utils.cpp2
-rw-r--r--src/p2p/net_peerlist.h2
-rw-r--r--src/wallet/wallet2.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp
index 854f3d1c5..4cf71e558 100644
--- a/src/cryptonote_core/cryptonote_tx_utils.cpp
+++ b/src/cryptonote_core/cryptonote_tx_utils.cpp
@@ -354,7 +354,7 @@ namespace cryptonote
if (shuffle_outs)
{
- std::shuffle(destinations.begin(), destinations.end(), std::default_random_engine(crypto::rand<unsigned int>()));
+ std::shuffle(destinations.begin(), destinations.end(), crypto::random_device{});
}
// sort ins by their key image
diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h
index 68627375a..c65b9dd82 100644
--- a/src/p2p/net_peerlist.h
+++ b/src/p2p/net_peerlist.h
@@ -293,7 +293,7 @@ namespace nodetool
if (anonymize)
{
- std::random_shuffle(bs_head.begin(), bs_head.end());
+ std::shuffle(bs_head.begin(), bs_head.end(), crypto::random_device{});
if (bs_head.size() > depth)
bs_head.resize(depth);
for (auto &e: bs_head)
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 23c375924..117ad4ea8 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -7450,7 +7450,7 @@ void wallet2::light_wallet_get_outs(std::vector<std::vector<tools::wallet2::get_
order.resize(light_wallet_requested_outputs_count);
for (size_t n = 0; n < order.size(); ++n)
order[n] = n;
- std::shuffle(order.begin(), order.end(), std::default_random_engine(crypto::rand<unsigned>()));
+ std::shuffle(order.begin(), order.end(), crypto::random_device{});
LOG_PRINT_L2("Looking for " << (fake_outputs_count+1) << " outputs with amounts " << print_money(td.is_rct() ? 0 : td.amount()));
@@ -8025,7 +8025,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
order.resize(requested_outputs_count);
for (size_t n = 0; n < order.size(); ++n)
order[n] = n;
- std::shuffle(order.begin(), order.end(), std::default_random_engine(crypto::rand<unsigned>()));
+ std::shuffle(order.begin(), order.end(), crypto::random_device{});
LOG_PRINT_L2("Looking for " << (fake_outputs_count+1) << " outputs of size " << print_money(td.is_rct() ? 0 : td.amount()));
for (size_t o = 0; o < requested_outputs_count && outs.back().size() < fake_outputs_count + 1; ++o)