Skip to content

Commit 0173ee3

Browse files
sipaWarrows
authored andcommitted
Replace rand() & ((1 << N) - 1) with randbits(N)
1 parent 250de74 commit 0173ee3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/pmt_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(pmt_test1)
6161
std::vector<bool> vMatch(nTx, false);
6262
std::vector<uint256> vMatchTxid1;
6363
for (unsigned int j=0; j<nTx; j++) {
64-
bool fInclude = (rand() & ((1 << (att/2)) - 1)) == 0;
64+
bool fInclude = insecure_randbits(att / 2) == 0;
6565
vMatch[j] = fInclude;
6666
if (fInclude)
6767
vMatchTxid1.push_back(vTxid[j]);

0 commit comments

Comments
 (0)