mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Make unit tests use the insecure_rand_ctx exclusively
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user