Auto merge of #3160 - bitcartel:3134_least_authority_issue_e, r=daira

Closes #3134 - Least Authority Issue E

CTxMemPool::check() does nothing when turned on, due to overflow.
This commit is contained in:
Homu
2018-04-16 11:25:43 -07:00
2 changed files with 16 additions and 1 deletions

View File

@@ -212,4 +212,14 @@ BOOST_AUTO_TEST_CASE(RemoveWithoutBranchId) {
BOOST_CHECK_EQUAL(pool.size(), 0);
}
// Test that nCheckFrequency is set correctly when calling setSanityCheck().
// https://github.com/zcash/zcash/issues/3134
BOOST_AUTO_TEST_CASE(SetSanityCheck) {
CTxMemPool pool(CFeeRate(0));
pool.setSanityCheck(1.0);
BOOST_CHECK_EQUAL(pool.GetCheckFrequency(), 4294967295);
pool.setSanityCheck(0);
BOOST_CHECK_EQUAL(pool.GetCheckFrequency(), 0);
}
BOOST_AUTO_TEST_SUITE_END()