aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-02-15 15:23:34 -0500
committerAlex Morcos <morcos@chaincode.com>2017-04-10 13:56:50 -0400
commit14e10aa842b8583f9648accd5d151dbdf342b9dc (patch)
treebd9cb352c1734d8ec7dbd87fee74b1f91e77644b /src/policy
parentdbb9e3699b8e835fd72a5db2c22927d828484c32 (diff)
downloadbitcoin-14e10aa842b8583f9648accd5d151dbdf342b9dc.tar.xz
Call estimate(Smart)Fee directly from CBlockPolicyEstimator
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/fees.cpp6
-rw-r--r--src/policy/fees.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index 05f2a20e9a..66da753a8b 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -77,7 +77,7 @@ void TxConfirmStats::UpdateMovingAverages()
// returns -1 on error conditions
double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,
double successBreakPoint, bool requireGreater,
- unsigned int nBlockHeight)
+ unsigned int nBlockHeight) const
{
// Counters for a bucket (or range of buckets)
double nConf = 0; // Number of tx's confirmed within the confTarget
@@ -411,7 +411,7 @@ void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight,
untrackedTxs = 0;
}
-CFeeRate CBlockPolicyEstimator::estimateFee(int confTarget)
+CFeeRate CBlockPolicyEstimator::estimateFee(int confTarget) const
{
LOCK(cs_feeEstimator);
// Return failure if trying to analyze a target we're not tracking
@@ -427,7 +427,7 @@ CFeeRate CBlockPolicyEstimator::estimateFee(int confTarget)
return CFeeRate(median);
}
-CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool)
+CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool) const
{
if (answerFoundAtTarget)
*answerFoundAtTarget = confTarget;
diff --git a/src/policy/fees.h b/src/policy/fees.h
index e11a6582a4..2299144b94 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -150,10 +150,10 @@ public:
* @param nBlockHeight the current block height
*/
double EstimateMedianVal(int confTarget, double sufficientTxVal,
- double minSuccess, bool requireGreater, unsigned int nBlockHeight);
+ double minSuccess, bool requireGreater, unsigned int nBlockHeight) const;
/** Return the max number of confirms we're tracking */
- unsigned int GetMaxConfirms() { return confAvg.size(); }
+ unsigned int GetMaxConfirms() const { return confAvg.size(); }
/** Write state of estimation data to a file*/
void Write(CAutoFile& fileout);
@@ -217,13 +217,13 @@ public:
bool removeTx(uint256 hash);
/** Return a feerate estimate */
- CFeeRate estimateFee(int confTarget);
+ CFeeRate estimateFee(int confTarget) const;
/** Estimate feerate needed to get be included in a block within
* confTarget blocks. If no answer can be given at confTarget, return an
* estimate at the lowest target where one can be given.
*/
- CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool);
+ CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool& pool) const;
/** Write estimation data to a file */
void Write(CAutoFile& fileout);