Skip to content

Commit 81fd84c

Browse files
committed
[Refactoring] Replace risky call to rand() with GetRandInt()
1 parent 8ba1978 commit 81fd84c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/budget/budgetmanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ void CBudgetManager::VoteOnFinalizedBudgets()
462462

463463
// Do this 1 in 4 blocks -- spread out the voting activity
464464
// -- this function is only called every fourteenth block, so this is really 1 in 56 blocks
465-
if (rand() % 4 != 0) {
465+
if (GetRandInt(4) != 0) {
466466
LogPrint(BCLog::MNBUDGET,"%s: waiting\n", __func__);
467467
return;
468468
}
@@ -832,7 +832,7 @@ void CBudgetManager::NewBlock(int height)
832832
// incremental sync with our peers
833833
if (masternodeSync.IsSynced()) {
834834
LogPrint(BCLog::MNBUDGET,"%s: incremental sync started\n", __func__);
835-
if (rand() % 1440 == 0) {
835+
if (GetRandInt(1440) == 0) {
836836
ClearSeen();
837837
ResetSync();
838838
}

0 commit comments

Comments
 (0)