mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #10514: Bugfix: missing == 0 after randrange
9aa215b
Bugfixes: missing == 0 after randrange (Pieter Wuille)
Tree-SHA512: 160657ac09553f23ad7a3966c753a30ba938ce6f7ccfd34a4ef0d05d73d712362f7eef97e44a96e37a181b8347caa9d8e1584cc4485f69674ab2de3d8a247373
This commit is contained in:
commit
e103b3ff1e
@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(coins_cache_simulation_test)
|
||||
}
|
||||
|
||||
// One every 10 iterations, remove a random entry from the cache
|
||||
if (insecure_rand() % 10) {
|
||||
if (insecure_rand() % 10 == 0) {
|
||||
COutPoint out(txids[insecure_rand() % txids.size()], 0);
|
||||
int cacheid = insecure_rand() % stack.size();
|
||||
stack[cacheid]->Uncache(out);
|
||||
@ -422,13 +422,13 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
|
||||
}
|
||||
|
||||
// One every 10 iterations, remove a random entry from the cache
|
||||
if (utxoset.size() > 1 && insecure_rand() % 30) {
|
||||
if (utxoset.size() > 1 && insecure_rand() % 30 == 0) {
|
||||
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(utxoset)->first);
|
||||
}
|
||||
if (disconnected_coins.size() > 1 && insecure_rand() % 30) {
|
||||
if (disconnected_coins.size() > 1 && insecure_rand() % 30 == 0) {
|
||||
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(disconnected_coins)->first);
|
||||
}
|
||||
if (duplicate_coins.size() > 1 && insecure_rand() % 30) {
|
||||
if (duplicate_coins.size() > 1 && insecure_rand() % 30 == 0) {
|
||||
stack[insecure_rand() % stack.size()]->Uncache(FindRandomFrom(duplicate_coins)->first);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user