diff options
author | Alex Morcos <morcos@chaincode.com> | 2016-11-29 12:18:44 -0500 |
---|---|---|
committer | Alex Morcos <morcos@chaincode.com> | 2016-11-29 12:18:44 -0500 |
commit | d824ad030e70bc72e0c63e1b0d00b08413024b55 (patch) | |
tree | 4edc345a21147e3f4d69987db095857a2e3c1738 /src/policy | |
parent | e56cf67e6b3f2e87bee42aaa5ab709f479c9e6ca (diff) |
Disable fee estimates for a confirm target of 1 block
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/fees.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 7113390cdf..9eb831bc17 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -404,7 +404,8 @@ void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight, CFeeRate CBlockPolicyEstimator::estimateFee(int confTarget) { // Return failure if trying to analyze a target we're not tracking - if (confTarget <= 0 || (unsigned int)confTarget > feeStats.GetMaxConfirms()) + // It's not possible to get reasonable estimates for confTarget of 1 + if (confTarget <= 1 || (unsigned int)confTarget > feeStats.GetMaxConfirms()) return CFeeRate(0); double median = feeStats.EstimateMedianVal(confTarget, SUFFICIENT_FEETXS, MIN_SUCCESS_PCT, true, nBestSeenHeight); @@ -423,6 +424,10 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, int *answerFoun if (confTarget <= 0 || (unsigned int)confTarget > feeStats.GetMaxConfirms()) return CFeeRate(0); + // It's not possible to get reasonable estimates for confTarget of 1 + if (confTarget == 1) + confTarget = 2; + double median = -1; while (median < 0 && (unsigned int)confTarget <= feeStats.GetMaxConfirms()) { median = feeStats.EstimateMedianVal(confTarget++, SUFFICIENT_FEETXS, MIN_SUCCESS_PCT, true, nBestSeenHeight); |