aboutsummaryrefslogtreecommitdiff
path: root/src/test/sighash_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-06-07 11:34:55 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-07 11:34:55 -0700
commit3ecabae36364e905e7821fba3e60aa7f8418de6c (patch)
tree04b22d1cf440fcedacdea019f6421c629d766b44 /src/test/sighash_tests.cpp
parentefee1db21a652019e0ab18fffc233d91bb7f1816 (diff)
downloadbitcoin-3ecabae36364e905e7821fba3e60aa7f8418de6c.tar.xz
Replace more rand() % NUM by randranges
Diffstat (limited to 'src/test/sighash_tests.cpp')
-rw-r--r--src/test/sighash_tests.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp
index 564fc6b944..805c09c1a4 100644
--- a/src/test/sighash_tests.cpp
+++ b/src/test/sighash_tests.cpp
@@ -91,7 +91,7 @@ void static RandomScript(CScript &script) {
script = CScript();
int ops = (insecure_randrange(10));
for (int i=0; i<ops; i++)
- script << oplist[insecure_rand() % (sizeof(oplist)/sizeof(oplist[0]))];
+ script << oplist[insecure_randrange(sizeof(oplist)/sizeof(oplist[0]))];
}
void static RandomTransaction(CMutableTransaction &tx, bool fSingle) {
@@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(sighash_test)
RandomTransaction(txTo, (nHashType & 0x1f) == SIGHASH_SINGLE);
CScript scriptCode;
RandomScript(scriptCode);
- int nIn = insecure_rand() % txTo.vin.size();
+ int nIn = insecure_randrange(txTo.vin.size());
uint256 sh, sho;
sho = SignatureHashOld(scriptCode, txTo, nIn, nHashType);