Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 960 Lines • ▼ Show 20 Lines | CFeeRate CTxMemPool::estimateFee(int nBlocks) const { | ||||
uint64_t maxMempoolSize = | uint64_t maxMempoolSize = | ||||
gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; | ||||
// minerPolicy uses recent blocks to figure out a reasonable fee. This | // minerPolicy uses recent blocks to figure out a reasonable fee. This | ||||
// may disagree with the rollingMinimumFeerate under certain scenarios | // may disagree with the rollingMinimumFeerate under certain scenarios | ||||
// where the mempool increases rapidly, or blocks are being mined which | // where the mempool increases rapidly, or blocks are being mined which | ||||
// do not contain propagated transactions. | // do not contain propagated transactions. | ||||
return std::max(GetConfig().GetMinFeePerKB(), GetMinFee(maxMempoolSize)); | return std::max(GetConfig().GetMinFeePerKB(), GetMinFee(maxMempoolSize)); | ||||
} | } | ||||
CFeeRate CTxMemPool::estimateSmartFee(int nBlocks, | CFeeRate CTxMemPool::estimateSmartFee(int nBlocks, | ||||
int *answerFoundAtBlocks) const { | int *answerFoundAtBlocks) const { | ||||
if (answerFoundAtBlocks != nullptr) { | if (answerFoundAtBlocks != nullptr) { | ||||
*answerFoundAtBlocks = 1; | *answerFoundAtBlocks = 1; | ||||
} | } | ||||
// estimateSmartFee already includes the GetMinFee check, this is the | // estimateSmartFee already includes the GetMinFee check, this is the | ||||
// reason it takes `*this`. It does not need std::max as above. | // reason it takes `*this`. It does not need std::max as above. | ||||
return estimateFee(nBlocks); | return estimateFee(nBlocks); | ||||
▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines |