Undo GetMinFee-requires-extra-call-to-hit-0

pull/262/head
Matt Corallo 9 years ago
parent 9e93640be6
commit 8abe0f5658

@ -428,7 +428,6 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
// ... but feerate should never drop below 1000 // ... but feerate should never drop below 1000
SetMockTime(42 + 8*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4); SetMockTime(42 + 8*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);
pool.GetMinFee(1);
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 0); BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 0);
// ... unless it has gone all the way to 0 (after getting past 1000/2) // ... unless it has gone all the way to 0 (after getting past 1000/2)

@ -879,8 +879,10 @@ CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {
rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife); rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife);
lastRollingFeeUpdate = time; lastRollingFeeUpdate = time;
if (rollingMinimumFeeRate < minReasonableRelayFee.GetFeePerK() / 2) if (rollingMinimumFeeRate < minReasonableRelayFee.GetFeePerK() / 2) {
rollingMinimumFeeRate = 0; rollingMinimumFeeRate = 0;
return CFeeRate(0);
}
} }
return std::max(CFeeRate(rollingMinimumFeeRate), minReasonableRelayFee); return std::max(CFeeRate(rollingMinimumFeeRate), minReasonableRelayFee);
} }

Loading…
Cancel
Save