Changeset View
Changeset View
Standalone View
Standalone View
src/policy/fees.cpp
Show First 20 Lines • Show All 515 Lines • ▼ Show 20 Lines | CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, | ||||
if (median < 0) { | if (median < 0) { | ||||
return CFeeRate(Amount(0)); | return CFeeRate(Amount(0)); | ||||
} | } | ||||
return CFeeRate(Amount(int64_t(median))); | return CFeeRate(Amount(int64_t(median))); | ||||
} | } | ||||
double CBlockPolicyEstimator::estimateSmartPriority(int confTarget, | |||||
int *answerFoundAtTarget, | |||||
const CTxMemPool &pool) { | |||||
if (answerFoundAtTarget) { | |||||
*answerFoundAtTarget = confTarget; | |||||
} | |||||
// If mempool is limiting txs, no priority txs are allowed | |||||
Amount minPoolFee = | |||||
pool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * | |||||
1000000) | |||||
.GetFeePerK(); | |||||
if (minPoolFee > Amount(0)) { | |||||
return double(INF_PRIORITY.GetSatoshis()); | |||||
} | |||||
return -1; | |||||
} | |||||
void CBlockPolicyEstimator::Write(CAutoFile &fileout) { | void CBlockPolicyEstimator::Write(CAutoFile &fileout) { | ||||
fileout << nBestSeenHeight; | fileout << nBestSeenHeight; | ||||
feeStats.Write(fileout); | feeStats.Write(fileout); | ||||
} | } | ||||
void CBlockPolicyEstimator::Read(CAutoFile &filein, int nFileVersion) { | void CBlockPolicyEstimator::Read(CAutoFile &filein, int nFileVersion) { | ||||
int nFileBestSeenHeight; | int nFileBestSeenHeight; | ||||
filein >> nFileBestSeenHeight; | filein >> nFileBestSeenHeight; | ||||
Show All 28 Lines |