Skip to content

Commit 2a7b56c

Browse files
committed
CBlockPolicyEstimator now uses hard coded minimum bucket feerate
1 parent ac9d3d2 commit 2a7b56c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/policy/fees.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ bool CBlockPolicyEstimator::removeTx(uint256 hash)
298298
}
299299
}
300300

301-
CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)
301+
CBlockPolicyEstimator::CBlockPolicyEstimator()
302302
: nBestSeenHeight(0), trackedTxs(0), untrackedTxs(0)
303303
{
304304
static_assert(MIN_BUCKET_FEERATE > 0, "Min feerate must be nonzero");
305-
minTrackedFee = _minRelayFee < CFeeRate(MIN_BUCKET_FEERATE) ? CFeeRate(MIN_BUCKET_FEERATE) : _minRelayFee;
305+
minTrackedFee = CFeeRate(MIN_BUCKET_FEERATE);
306306
std::vector<double> vfeelist;
307307
for (double bucketBoundary = minTrackedFee.GetFeePerK(); bucketBoundary <= MAX_BUCKET_FEERATE; bucketBoundary *= FEE_SPACING) {
308308
vfeelist.push_back(bucketBoundary);

src/policy/fees.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ static const double MIN_SUCCESS_PCT = .95;
179179
static const double SUFFICIENT_FEETXS = 1;
180180

181181
// Minimum and Maximum values for tracking feerates
182-
static constexpr double MIN_BUCKET_FEERATE = 10;
182+
// The MIN_BUCKET_FEERATE should just be set to the lowest reasonable feerate we
183+
// might ever want to track. Historically this has been 1000 since it was
184+
// inheriting DEFAULT_MIN_RELAY_TX_FEE and changing it is disruptive as it
185+
// invalidates old estimates files. So leave it at 1000 unless it becomes
186+
// necessary to lower it, and then lower it substantially.
187+
static constexpr double MIN_BUCKET_FEERATE = 1000;
183188
static const double MAX_BUCKET_FEERATE = 1e7;
184189
static const double INF_FEERATE = MAX_MONEY;
185190
static const double INF_PRIORITY = 1e9 * MAX_MONEY;
@@ -199,7 +204,7 @@ class CBlockPolicyEstimator
199204
{
200205
public:
201206
/** Create new BlockPolicyEstimator and initialize stats tracking classes with default values */
202-
CBlockPolicyEstimator(const CFeeRate& minRelayFee);
207+
CBlockPolicyEstimator();
203208

204209
/** Process all the transactions that have been included in a block */
205210
void processBlock(unsigned int nBlockHeight,

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ CTxMemPool::CTxMemPool(const CFeeRate& _minReasonableRelayFee) :
358358
// of transactions in the pool
359359
nCheckFrequency = 0;
360360

361-
minerPolicyEstimator = new CBlockPolicyEstimator(_minReasonableRelayFee);
361+
minerPolicyEstimator = new CBlockPolicyEstimator();
362362
}
363363

364364
CTxMemPool::~CTxMemPool()

0 commit comments

Comments
 (0)