aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-10-31 15:05:42 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-12-12 14:22:12 -0800
commit273d02580aa736b7ccea8fce51d90541665fdbd1 (patch)
treef7ef66e7d380215feac25aea060aef8c8e56a6a9 /src
parent3db746beb407f7cdd9cd6a605a195bef1254b4c0 (diff)
downloadbitcoin-273d02580aa736b7ccea8fce51d90541665fdbd1.tar.xz
Use a FastRandomContext in LimitOrphanTxSize
Diffstat (limited to 'src')
-rw-r--r--src/net_processing.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 40c5112578..0e222bdfa4 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -779,10 +779,11 @@ unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)
nNextSweep = nMinExpTime + ORPHAN_TX_EXPIRE_INTERVAL;
if (nErased > 0) LogPrint(BCLog::MEMPOOL, "Erased %d orphan tx due to expiration\n", nErased);
}
+ FastRandomContext rng;
while (mapOrphanTransactions.size() > nMaxOrphans)
{
// Evict a random orphan:
- uint256 randomhash = GetRandHash();
+ uint256 randomhash = rng.rand256();
std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.lower_bound(randomhash);
if (it == mapOrphanTransactions.end())
it = mapOrphanTransactions.begin();