aboutsummaryrefslogtreecommitdiff
path: root/src/test/pmt_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-05-23 16:18:06 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-07 11:35:16 -0700
commit2fcd9cc86bfce944e3312e9a24685403250f3bdc (patch)
tree7aafcf14463ac2d6eabbc732c252d125a1b9ed1a /src/test/pmt_tests.cpp
parent2ada67852174a76753080d65a7adbe27241a9caa (diff)
scripted-diff: Use randbits/bool instead of randrange where possible
-BEGIN VERIFY SCRIPT- sed -i 's/insecure_randbits(1)/insecure_randbool()/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(4)/insecure_randbits(2)/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(32)/insecure_randbits(5)/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(256)/insecure_randbits(8)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
Diffstat (limited to 'src/test/pmt_tests.cpp')
-rw-r--r--src/test/pmt_tests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp
index 32086ead5e..4089374157 100644
--- a/src/test/pmt_tests.cpp
+++ b/src/test/pmt_tests.cpp
@@ -22,7 +22,7 @@ public:
// flip one bit in one of the hashes - this should break the authentication
void Damage() {
unsigned int n = insecure_randrange(vHash.size());
- int bit = insecure_randrange(256);
+ int bit = insecure_randbits(8);
*(vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
}
};