aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-01-19 15:17:33 -0500
committerAlex Morcos <morcos@chaincode.com>2017-02-27 11:23:51 -0500
commitfe282acd7604b5265762b24e531bdf1ebb1f009b (patch)
tree4f10b6a0221b8b706d58458f31855673c13fb36b /src
parent400b15147cf1c4757927935222611e8d3481e739 (diff)
[cleanup] Remove estimatePriority and estimateSmartPriority
Unused everywhere now except one test.
Diffstat (limited to 'src')
-rw-r--r--src/policy/fees.cpp18
-rw-r--r--src/policy/fees.h15
-rw-r--r--src/test/policyestimator_tests.cpp2
-rw-r--r--src/txmempool.cpp10
-rw-r--r--src/txmempool.h9
5 files changed, 0 insertions, 54 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index 8f6a1e60f4..89220f26b6 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -452,24 +452,6 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, int *answerFoun
return CFeeRate(median);
}
-double CBlockPolicyEstimator::estimatePriority(int confTarget)
-{
- return -1;
-}
-
-double CBlockPolicyEstimator::estimateSmartPriority(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool)
-{
- if (answerFoundAtTarget)
- *answerFoundAtTarget = confTarget;
-
- // If mempool is limiting txs, no priority txs are allowed
- CAmount minPoolFee = pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK();
- if (minPoolFee > 0)
- return INF_PRIORITY;
-
- return -1;
-}
-
void CBlockPolicyEstimator::Write(CAutoFile& fileout)
{
fileout << nBestSeenHeight;
diff --git a/src/policy/fees.h b/src/policy/fees.h
index 064466afe4..f2f430861c 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -182,7 +182,6 @@ static const double SUFFICIENT_FEETXS = 1;
static constexpr double MIN_FEERATE = 10;
static const double MAX_FEERATE = 1e7;
static const double INF_FEERATE = MAX_MONEY;
-static const double INF_PRIORITY = 1e9 * MAX_MONEY;
// We have to lump transactions into buckets based on feerate, but we want to be able
// to give accurate estimates over a large range of potential feerates
@@ -223,20 +222,6 @@ public:
*/
CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool);
- /** Return a priority estimate.
- * DEPRECATED
- * Returns -1
- */
- double estimatePriority(int confTarget);
-
- /** Estimate priority needed to get be included in a block within
- * confTarget blocks.
- * DEPRECATED
- * Returns -1 unless mempool is currently limited then returns INF_PRIORITY
- * answerFoundAtTarget is set to confTarget
- */
- double estimateSmartPriority(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool);
-
/** Write estimation data to a file */
void Write(CAutoFile& fileout);
diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp
index 0c060801bc..a4f85c5988 100644
--- a/src/test/policyestimator_tests.cpp
+++ b/src/test/policyestimator_tests.cpp
@@ -185,7 +185,6 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
}
// Test that if the mempool is limited, estimateSmartFee won't return a value below the mempool min fee
- // and that estimateSmartPriority returns essentially an infinite value
mpool.addUnchecked(tx.GetHash(), entry.Fee(feeV[5]).Time(GetTime()).Priority(0).Height(blocknum).FromTx(tx, &mpool));
// evict that transaction which should set a mempool min fee of minRelayTxFee + feeV[5]
mpool.TrimToSize(1);
@@ -193,7 +192,6 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
for (int i = 1; i < 10; i++) {
BOOST_CHECK(mpool.estimateSmartFee(i).GetFeePerK() >= mpool.estimateFee(i).GetFeePerK());
BOOST_CHECK(mpool.estimateSmartFee(i).GetFeePerK() >= mpool.GetMinFee(1).GetFeePerK());
- BOOST_CHECK(mpool.estimateSmartPriority(i) == INF_PRIORITY);
}
}
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 942a6fcce7..ef4d4f3c62 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -875,16 +875,6 @@ CFeeRate CTxMemPool::estimateSmartFee(int nBlocks, int *answerFoundAtBlocks) con
LOCK(cs);
return minerPolicyEstimator->estimateSmartFee(nBlocks, answerFoundAtBlocks, *this);
}
-double CTxMemPool::estimatePriority(int nBlocks) const
-{
- LOCK(cs);
- return minerPolicyEstimator->estimatePriority(nBlocks);
-}
-double CTxMemPool::estimateSmartPriority(int nBlocks, int *answerFoundAtBlocks) const
-{
- LOCK(cs);
- return minerPolicyEstimator->estimateSmartPriority(nBlocks, answerFoundAtBlocks, *this);
-}
bool
CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
diff --git a/src/txmempool.h b/src/txmempool.h
index 4cba024307..4af85195c8 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -648,15 +648,6 @@ public:
/** Estimate fee rate needed to get into the next nBlocks */
CFeeRate estimateFee(int nBlocks) const;
- /** Estimate priority needed to get into the next nBlocks
- * If no answer can be given at nBlocks, return an estimate
- * at the lowest number of blocks where one can be given
- */
- double estimateSmartPriority(int nBlocks, int *answerFoundAtBlocks = NULL) const;
-
- /** Estimate priority needed to get into the next nBlocks */
- double estimatePriority(int nBlocks) const;
-
/** Write/Read estimates to disk */
bool WriteFeeEstimates(CAutoFile& fileout) const;
bool ReadFeeEstimates(CAutoFile& filein);