@@ -80,7 +80,7 @@ class VersionBitsTester
80
80
81
81
VersionBitsTester& TestStateSinceHeight (int height) {
82
82
for (int i = 0 ; i < CHECKERS; i++) {
83
- if (( insecure_rand () & (( 1 << i) - 1 ) ) == 0 ) {
83
+ if (insecure_randbits (i ) == 0 ) {
84
84
BOOST_CHECK_MESSAGE (checker[i].GetStateSinceHeightFor (vpblock.empty () ? NULL : vpblock.back ()) == height, strprintf (" Test %i for StateSinceHeight" , num));
85
85
}
86
86
}
@@ -90,7 +90,7 @@ class VersionBitsTester
90
90
91
91
VersionBitsTester& TestDefined () {
92
92
for (int i = 0 ; i < CHECKERS; i++) {
93
- if (( insecure_rand () & (( 1 << i) - 1 ) ) == 0 ) {
93
+ if (insecure_randbits (i ) == 0 ) {
94
94
BOOST_CHECK_MESSAGE (checker[i].GetStateFor (vpblock.empty () ? NULL : vpblock.back ()) == THRESHOLD_DEFINED, strprintf (" Test %i for DEFINED" , num));
95
95
}
96
96
}
@@ -100,7 +100,7 @@ class VersionBitsTester
100
100
101
101
VersionBitsTester& TestStarted () {
102
102
for (int i = 0 ; i < CHECKERS; i++) {
103
- if (( insecure_rand () & (( 1 << i) - 1 ) ) == 0 ) {
103
+ if (insecure_randbits (i ) == 0 ) {
104
104
BOOST_CHECK_MESSAGE (checker[i].GetStateFor (vpblock.empty () ? NULL : vpblock.back ()) == THRESHOLD_STARTED, strprintf (" Test %i for STARTED" , num));
105
105
}
106
106
}
@@ -110,7 +110,7 @@ class VersionBitsTester
110
110
111
111
VersionBitsTester& TestLockedIn () {
112
112
for (int i = 0 ; i < CHECKERS; i++) {
113
- if (( insecure_rand () & (( 1 << i) - 1 ) ) == 0 ) {
113
+ if (insecure_randbits (i ) == 0 ) {
114
114
BOOST_CHECK_MESSAGE (checker[i].GetStateFor (vpblock.empty () ? NULL : vpblock.back ()) == THRESHOLD_LOCKED_IN, strprintf (" Test %i for LOCKED_IN" , num));
115
115
}
116
116
}
@@ -120,7 +120,7 @@ class VersionBitsTester
120
120
121
121
VersionBitsTester& TestActive () {
122
122
for (int i = 0 ; i < CHECKERS; i++) {
123
- if (( insecure_rand () & (( 1 << i) - 1 ) ) == 0 ) {
123
+ if (insecure_randbits (i ) == 0 ) {
124
124
BOOST_CHECK_MESSAGE (checker[i].GetStateFor (vpblock.empty () ? NULL : vpblock.back ()) == THRESHOLD_ACTIVE, strprintf (" Test %i for ACTIVE" , num));
125
125
}
126
126
}
@@ -130,7 +130,7 @@ class VersionBitsTester
130
130
131
131
VersionBitsTester& TestFailed () {
132
132
for (int i = 0 ; i < CHECKERS; i++) {
133
- if (( insecure_rand () & (( 1 << i) - 1 ) ) == 0 ) {
133
+ if (insecure_randbits (i ) == 0 ) {
134
134
BOOST_CHECK_MESSAGE (checker[i].GetStateFor (vpblock.empty () ? NULL : vpblock.back ()) == THRESHOLD_FAILED, strprintf (" Test %i for FAILED" , num));
135
135
}
136
136
}
0 commit comments