Skip to content

Commit e103b3f

Browse files
committed
Merge #10514: Bugfix: missing == 0 after randrange
9aa215b Bugfixes: missing == 0 after randrange (Pieter Wuille) Tree-SHA512: 160657ac09553f23ad7a3966c753a30ba938ce6f7ccfd34a4ef0d05d73d712362f7eef97e44a96e37a181b8347caa9d8e1584cc4485f69674ab2de3d8a247373
2 parents 296928e + 9aa215b commit e103b3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/coins_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
173173
}
174174

175175
// One every 10 iterations, remove a random entry from the cache
176-
if (insecure_rand() % 10) {
176+
if (insecure_rand() % 10 == 0) {
177177
COutPoint out(txids[insecure_rand() % txids.size()], 0);
178178
int cacheid = insecure_rand() % stack.size();
179179
stack[cacheid]->Uncache(out);
@@ -422,13 +422,13 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
422422
}
423423

424424
// One every 10 iterations, remove a random entry from the cache
425-
if (utxoset.size() > 1 && insecure_rand() % 30) {
425+
if (utxoset.size() > 1 && insecure_rand() % 30 == 0) {
426426
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(utxoset)->first);
427427
}
428-
if (disconnected_coins.size() > 1 && insecure_rand() % 30) {
428+
if (disconnected_coins.size() > 1 && insecure_rand() % 30 == 0) {
429429
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(disconnected_coins)->first);
430430
}
431-
if (duplicate_coins.size() > 1 && insecure_rand() % 30) {
431+
if (duplicate_coins.size() > 1 && insecure_rand() % 30 == 0) {
432432
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(duplicate_coins)->first);
433433
}
434434

0 commit comments

Comments
 (0)