Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 958 Lines • ▼ Show 20 Lines | if (i == mapTx.end()) { | ||||
return TxMempoolInfo(); | return TxMempoolInfo(); | ||||
} | } | ||||
return GetInfo(i); | return GetInfo(i); | ||||
} | } | ||||
CFeeRate CTxMemPool::estimateFee(int nBlocks) const { | CFeeRate CTxMemPool::estimateFee(int nBlocks) const { | ||||
LOCK(cs); | 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, | CFeeRate CTxMemPool::estimateSmartFee(int nBlocks, | ||||
int *answerFoundAtBlocks) const { | int *answerFoundAtBlocks) const { | ||||
LOCK(cs); | LOCK(cs); | ||||
return minerPolicyEstimator->estimateSmartFee(nBlocks, answerFoundAtBlocks, | // minerPolicy uses recent blocks to figure out a reasonable fee. This may | ||||
*this); | // 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 { | bool CTxMemPool::WriteFeeEstimates(CAutoFile &fileout) const { | ||||
try { | try { | ||||
LOCK(cs); | LOCK(cs); | ||||
// version required to read: 0.13.99 or later | // version required to read: 0.13.99 or later | ||||
fileout << 139900; | fileout << 139900; | ||||
// version that wrote the file | // version that wrote the file | ||||
▲ Show 20 Lines • Show All 423 Lines • Show Last 20 Lines |