fix overflow in amount_tests

This commit is contained in:
Brannon King 2019-02-04 08:50:48 -07:00 committed by lbrynaut
parent 60f98b3300
commit 018458edbe
2 changed files with 3 additions and 3 deletions

View file

@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(GetFeeTest)
BOOST_CHECK(CFeeRate(CAmount(26), 789) == CFeeRate(32));
BOOST_CHECK(CFeeRate(CAmount(27), 789) == CFeeRate(34));
// Maximum size in bytes, should not crash
CFeeRate(MAX_MONEY, std::numeric_limits<size_t>::max() >> 1).GetFeePerK();
CFeeRate(MAX_MONEY / 1000, std::numeric_limits<size_t>::max() >> 1).GetFeePerK();
}
BOOST_AUTO_TEST_CASE(BinaryOperatorTest)

View file

@ -203,9 +203,9 @@ struct ClaimTrieChainFixture{
assert(0);
}
LOCK(cs_main);
CValidationState state;
CAmount txFeeRate = CAmount(0);
LOCK(cs_main);
BOOST_CHECK(AcceptToMemoryPool(mempool, state, MakeTransactionRef(tx), nullptr, nullptr, false, txFeeRate, false));
}
@ -297,9 +297,9 @@ struct ClaimTrieChainFixture{
{
for (int i = 0; i < num_blocks; i++) {
CValidationState state;
CBlockIndex* pblockindex = chainActive.Tip();
{
LOCK(cs_main);
CBlockIndex* pblockindex = chainActive.Tip();
InvalidateBlock(state, Params(), pblockindex);
}
if (state.IsValid())