mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
scripted-diff: use insecure_rand256/randrange more
-BEGIN VERIFY SCRIPT- sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(merkle_test)
|
||||
{
|
||||
for (int i = 0; i < 32; i++) {
|
||||
// Try 32 block sizes: all sizes from 0 to 16 inclusive, and then 15 random sizes.
|
||||
int ntx = (i <= 16) ? i : 17 + (insecure_rand() % 4000);
|
||||
int ntx = (i <= 16) ? i : 17 + (insecure_randrange(4000));
|
||||
// Try up to 3 mutations.
|
||||
for (int mutate = 0; mutate <= 3; mutate++) {
|
||||
int duplicate1 = mutate >= 1 ? 1 << ctz(ntx) : 0; // The last how many transactions to duplicate first.
|
||||
|
||||
Reference in New Issue
Block a user