Replace more rand() % NUM by randranges

This commit is contained in:
Pieter Wuille
2017-06-07 11:34:55 -07:00
parent efee1db21a
commit 3ecabae363
7 changed files with 19 additions and 19 deletions

View File

@@ -21,7 +21,7 @@ class CPartialMerkleTreeTester : public CPartialMerkleTree
public:
// flip one bit in one of the hashes - this should break the authentication
void Damage() {
unsigned int n = insecure_rand() % vHash.size();
unsigned int n = insecure_randrange(vHash.size());
int bit = insecure_randrange(256);
*(vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
}