Skip to content

Commit

Permalink
Initialize randomness in benchmarks
Browse files Browse the repository at this point in the history
Call RandomInit() in bench_bitcoin to initialize the RNG so that it
does not cause an assertion error.

Cherry-picked from: 5155d11
  • Loading branch information
achow101 authored and xanimo committed Mar 27, 2024
1 parent 2d9419a commit 40f7e75
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bench/bench_bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
#include "bench.h" // for BenchRunner
#include "key.h" // for ECC_Start, ECC_Stop
#include "util.h" // for SetupEnvironment, fPrintToDebugLog
#include "validation.h"
#include "random.h"

int
main(int argc, char** argv)
{
RandomInit();
ECC_Start();
SetupEnvironment();
fPrintToDebugLog = false; // don't want to write to debug.log file
Expand Down

0 comments on commit 40f7e75

Please sign in to comment.