mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Replace more rand() % NUM by randranges
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user