diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2018-10-31 15:05:42 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2018-12-12 14:22:12 -0800 |
commit | 273d02580aa736b7ccea8fce51d90541665fdbd1 (patch) | |
tree | f7ef66e7d380215feac25aea060aef8c8e56a6a9 /src | |
parent | 3db746beb407f7cdd9cd6a605a195bef1254b4c0 (diff) |
Use a FastRandomContext in LimitOrphanTxSize
Diffstat (limited to 'src')
-rw-r--r-- | src/net_processing.cpp | 3 |
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(); |