mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 10:30:52 +00:00
Merge pull request #3560 from patricklodder/compat/shuffle
random: use std::shuffle instead of std::random_shuffle
This commit is contained in:
commit
2e37a3a1ba
@ -1641,7 +1641,8 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
|
||||
// Randomize entries before processing, to prevent an attacker to
|
||||
// determine which entries will make it through the rate limit
|
||||
random_shuffle(vAddr.begin(), vAddr.end(), GetRandInt);
|
||||
FastRandomContext insecure_rand;
|
||||
shuffle(vAddr.begin(), vAddr.end(), insecure_rand);
|
||||
|
||||
BOOST_FOREACH(CAddress& addr, vAddr)
|
||||
{
|
||||
|
||||
@ -2157,6 +2157,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
|
||||
{
|
||||
setCoinsRet.clear();
|
||||
nValueRet = 0;
|
||||
FastRandomContext insecure_rand;
|
||||
|
||||
// List of values less than target
|
||||
pair<CAmount, pair<const CWalletTx*,unsigned int> > coinLowestLarger;
|
||||
@ -2165,7 +2166,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
|
||||
vector<pair<CAmount, pair<const CWalletTx*,unsigned int> > > vValue;
|
||||
CAmount nTotalLower = 0;
|
||||
|
||||
random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);
|
||||
shuffle(vCoins.begin(), vCoins.end(), insecure_rand);
|
||||
|
||||
BOOST_FOREACH(const COutput &output, vCoins)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user