Replace rand() & ((1 << N) - 1) with randbits(N)

This commit is contained in:
Pieter Wuille
2017-06-07 11:34:58 -07:00
parent 3ecabae363
commit 5f0b04eedc
3 changed files with 9 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(pmt_test1)
std::vector<bool> vMatch(nTx, false);
std::vector<uint256> vMatchTxid1;
for (unsigned int j=0; j<nTx; j++) {
bool fInclude = (insecure_rand() & ((1 << (att/2)) - 1)) == 0;
bool fInclude = insecure_randbits(att / 2) == 0;
vMatch[j] = fInclude;
if (fInclude)
vMatchTxid1.push_back(vTxid[j]);