Skip to content

Commit af52bf5

Browse files
committed
Use a FastRandomContext in LimitOrphanTxSize
1 parent 746d466 commit af52bf5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,10 @@ void EraseOrphansFor(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
553553
unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
554554
{
555555
unsigned int nEvicted = 0;
556+
FastRandomContext rng;
556557
while (mapOrphanTransactions.size() > nMaxOrphans) {
557558
// Evict a random orphan:
558-
uint256 randomhash = GetRandHash();
559+
uint256 randomhash = rng.rand256();
559560
std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.lower_bound(randomhash);
560561
if (it == mapOrphanTransactions.end())
561562
it = mapOrphanTransactions.begin();

0 commit comments

Comments
 (0)