Changeset View
Changeset View
Standalone View
Standalone View
src/policy/fees.cpp
Show First 20 Lines • Show All 501 Lines • ▼ Show 20 Lines | CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, | ||||
if (answerFoundAtTarget) { | if (answerFoundAtTarget) { | ||||
*answerFoundAtTarget = confTarget - 1; | *answerFoundAtTarget = confTarget - 1; | ||||
} | } | ||||
// If mempool is limiting txs , return at least the min feerate from the | // If mempool is limiting txs , return at least the min feerate from the | ||||
// mempool | // mempool | ||||
Amount minPoolFee = | Amount minPoolFee = | ||||
pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * | pool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * | ||||
1000000) | 1000000) | ||||
.GetFeePerK(); | .GetFeePerK(); | ||||
if (minPoolFee > Amount(0) && minPoolFee > Amount(int64_t(median))) { | if (minPoolFee > Amount(0) && minPoolFee > Amount(int64_t(median))) { | ||||
return CFeeRate(minPoolFee); | return CFeeRate(minPoolFee); | ||||
} | } | ||||
if (median < 0) { | if (median < 0) { | ||||
return CFeeRate(Amount(0)); | return CFeeRate(Amount(0)); | ||||
Show All 10 Lines | double CBlockPolicyEstimator::estimateSmartPriority(int confTarget, | ||||
int *answerFoundAtTarget, | int *answerFoundAtTarget, | ||||
const CTxMemPool &pool) { | const CTxMemPool &pool) { | ||||
if (answerFoundAtTarget) { | if (answerFoundAtTarget) { | ||||
*answerFoundAtTarget = confTarget; | *answerFoundAtTarget = confTarget; | ||||
} | } | ||||
// If mempool is limiting txs, no priority txs are allowed | // If mempool is limiting txs, no priority txs are allowed | ||||
Amount minPoolFee = | Amount minPoolFee = | ||||
pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * | pool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * | ||||
1000000) | 1000000) | ||||
.GetFeePerK(); | .GetFeePerK(); | ||||
if (minPoolFee > Amount(0)) { | if (minPoolFee > Amount(0)) { | ||||
return double(INF_PRIORITY.GetSatoshis()); | return double(INF_PRIORITY.GetSatoshis()); | ||||
} | } | ||||
return -1; | return -1; | ||||
} | } | ||||
Show All 37 Lines |