aboutsummaryrefslogtreecommitdiff
path: root/src/test/validation_block_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-10-31 15:51:41 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-12-12 14:22:12 -0800
commitfd3e7973ffaaa15ed32e5aeadcb02956849b8fc7 (patch)
tree228672d42e4c5e3625b0979692f7b334226cd0a2 /src/test/validation_block_tests.cpp
parent8d98d426116f0178612f14d1874d331042c4c4b7 (diff)
Make unit tests use the insecure_rand_ctx exclusively
Diffstat (limited to 'src/test/validation_block_tests.cpp')
-rw-r--r--src/test/validation_block_tests.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp
index 4316f37999..fb0b8c0e16 100644
--- a/src/test/validation_block_tests.cpp
+++ b/src/test/validation_block_tests.cpp
@@ -104,8 +104,8 @@ void BuildChain(const uint256& root, int height, const unsigned int invalid_rate
{
if (height <= 0 || blocks.size() >= max_size) return;
- bool gen_invalid = GetRand(100) < invalid_rate;
- bool gen_fork = GetRand(100) < branch_rate;
+ bool gen_invalid = InsecureRandRange(100) < invalid_rate;
+ bool gen_fork = InsecureRandRange(100) < branch_rate;
const std::shared_ptr<const CBlock> pblock = gen_invalid ? BadBlock(root) : GoodBlock(root);
blocks.push_back(pblock);
@@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE(processnewblock_signals_ordering)
threads.create_thread([&blocks]() {
bool ignored;
for (int i = 0; i < 1000; i++) {
- auto block = blocks[GetRand(blocks.size() - 1)];
+ auto block = blocks[InsecureRandRange(blocks.size() - 1)];
ProcessNewBlock(Params(), block, true, &ignored);
}