diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -964,13 +964,27 @@ CFeeRate CTxMemPool::estimateFee(int nBlocks) const { LOCK(cs); - return minerPolicyEstimator->estimateFee(nBlocks); + // minerPolicy uses recent blocks to figure out a reasonable fee. This may + // disagree + // with the rollingMinimumFeerate under certain scenarios where the blocks + // include low fee + // transactions, but the mempool is being spammed. + // Therefore, use the maximum of the two values. + return std::ax(minerPolicyEstimator->estimateFee(nBlocks), + rollingMinimumFeeRate); } CFeeRate CTxMemPool::estimateSmartFee(int nBlocks, int *answerFoundAtBlocks) const { LOCK(cs); - return minerPolicyEstimator->estimateSmartFee(nBlocks, answerFoundAtBlocks, - *this); + // minerPolicy uses recent blocks to figure out a reasonable fee. This may + // disagree + // with the rollingMinimumFeerate under certain scenarios where the blocks + // include low fee + // transactions, but the mempool is being spammed. + // Therefore, use the maximum of the two values. + return std::max(minerPolicyEstimator->estimateSmartFee( + nBlocks, answerFoundAtBlocks, *this), + rollingMinimumFeeRate + Defaul); } bool CTxMemPool::WriteFeeEstimates(CAutoFile &fileout) const {