Skip to content

Commit fe282ac

Browse files
committed
[cleanup] Remove estimatePriority and estimateSmartPriority
Unused everywhere now except one test.
1 parent 400b151 commit fe282ac

File tree

5 files changed

+0
-54
lines changed

5 files changed

+0
-54
lines changed

src/policy/fees.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -452,24 +452,6 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, int *answerFoun
452452
return CFeeRate(median);
453453
}
454454

455-
double CBlockPolicyEstimator::estimatePriority(int confTarget)
456-
{
457-
return -1;
458-
}
459-
460-
double CBlockPolicyEstimator::estimateSmartPriority(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool)
461-
{
462-
if (answerFoundAtTarget)
463-
*answerFoundAtTarget = confTarget;
464-
465-
// If mempool is limiting txs, no priority txs are allowed
466-
CAmount minPoolFee = pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK();
467-
if (minPoolFee > 0)
468-
return INF_PRIORITY;
469-
470-
return -1;
471-
}
472-
473455
void CBlockPolicyEstimator::Write(CAutoFile& fileout)
474456
{
475457
fileout << nBestSeenHeight;

src/policy/fees.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ static const double SUFFICIENT_FEETXS = 1;
182182
static constexpr double MIN_FEERATE = 10;
183183
static const double MAX_FEERATE = 1e7;
184184
static const double INF_FEERATE = MAX_MONEY;
185-
static const double INF_PRIORITY = 1e9 * MAX_MONEY;
186185

187186
// We have to lump transactions into buckets based on feerate, but we want to be able
188187
// to give accurate estimates over a large range of potential feerates
@@ -223,20 +222,6 @@ class CBlockPolicyEstimator
223222
*/
224223
CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool);
225224

226-
/** Return a priority estimate.
227-
* DEPRECATED
228-
* Returns -1
229-
*/
230-
double estimatePriority(int confTarget);
231-
232-
/** Estimate priority needed to get be included in a block within
233-
* confTarget blocks.
234-
* DEPRECATED
235-
* Returns -1 unless mempool is currently limited then returns INF_PRIORITY
236-
* answerFoundAtTarget is set to confTarget
237-
*/
238-
double estimateSmartPriority(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool);
239-
240225
/** Write estimation data to a file */
241226
void Write(CAutoFile& fileout);
242227

src/test/policyestimator_tests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,13 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
185185
}
186186

187187
// Test that if the mempool is limited, estimateSmartFee won't return a value below the mempool min fee
188-
// and that estimateSmartPriority returns essentially an infinite value
189188
mpool.addUnchecked(tx.GetHash(), entry.Fee(feeV[5]).Time(GetTime()).Priority(0).Height(blocknum).FromTx(tx, &mpool));
190189
// evict that transaction which should set a mempool min fee of minRelayTxFee + feeV[5]
191190
mpool.TrimToSize(1);
192191
BOOST_CHECK(mpool.GetMinFee(1).GetFeePerK() > feeV[5]);
193192
for (int i = 1; i < 10; i++) {
194193
BOOST_CHECK(mpool.estimateSmartFee(i).GetFeePerK() >= mpool.estimateFee(i).GetFeePerK());
195194
BOOST_CHECK(mpool.estimateSmartFee(i).GetFeePerK() >= mpool.GetMinFee(1).GetFeePerK());
196-
BOOST_CHECK(mpool.estimateSmartPriority(i) == INF_PRIORITY);
197195
}
198196
}
199197

src/txmempool.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -875,16 +875,6 @@ CFeeRate CTxMemPool::estimateSmartFee(int nBlocks, int *answerFoundAtBlocks) con
875875
LOCK(cs);
876876
return minerPolicyEstimator->estimateSmartFee(nBlocks, answerFoundAtBlocks, *this);
877877
}
878-
double CTxMemPool::estimatePriority(int nBlocks) const
879-
{
880-
LOCK(cs);
881-
return minerPolicyEstimator->estimatePriority(nBlocks);
882-
}
883-
double CTxMemPool::estimateSmartPriority(int nBlocks, int *answerFoundAtBlocks) const
884-
{
885-
LOCK(cs);
886-
return minerPolicyEstimator->estimateSmartPriority(nBlocks, answerFoundAtBlocks, *this);
887-
}
888878

889879
bool
890880
CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const

src/txmempool.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,6 @@ class CTxMemPool
648648
/** Estimate fee rate needed to get into the next nBlocks */
649649
CFeeRate estimateFee(int nBlocks) const;
650650

651-
/** Estimate priority needed to get into the next nBlocks
652-
* If no answer can be given at nBlocks, return an estimate
653-
* at the lowest number of blocks where one can be given
654-
*/
655-
double estimateSmartPriority(int nBlocks, int *answerFoundAtBlocks = NULL) const;
656-
657-
/** Estimate priority needed to get into the next nBlocks */
658-
double estimatePriority(int nBlocks) const;
659-
660651
/** Write/Read estimates to disk */
661652
bool WriteFeeEstimates(CAutoFile& fileout) const;
662653
bool ReadFeeEstimates(CAutoFile& filein);

0 commit comments

Comments
 (0)