Skip to content

Commit 8abe0f5

Browse files
committed
Undo GetMinFee-requires-extra-call-to-hit-0
1 parent 9e93640 commit 8abe0f5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/test/mempool_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)
428428
// ... but feerate should never drop below 1000
429429

430430
SetMockTime(42 + 8*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);
431-
pool.GetMinFee(1);
432431
BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 0);
433432
// ... unless it has gone all the way to 0 (after getting past 1000/2)
434433

src/txmempool.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,10 @@ CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {
879879
rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife);
880880
lastRollingFeeUpdate = time;
881881

882-
if (rollingMinimumFeeRate < minReasonableRelayFee.GetFeePerK() / 2)
882+
if (rollingMinimumFeeRate < minReasonableRelayFee.GetFeePerK() / 2) {
883883
rollingMinimumFeeRate = 0;
884+
return CFeeRate(0);
885+
}
884886
}
885887
return std::max(CFeeRate(rollingMinimumFeeRate), minReasonableRelayFee);
886888
}

0 commit comments

Comments
 (0)