aboutsummaryrefslogtreecommitdiff
path: root/src/policy/fees.cpp
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-03-02 10:08:25 -0500
committerAlex Morcos <morcos@chaincode.com>2017-05-10 11:45:26 -0400
commit1ba43cc0ecaffcb6389dbbb6bcf038e78cf04023 (patch)
tree796977bf2f41e53fbe45b588151709fb47123fc7 /src/policy/fees.cpp
parentd3e30bca1bfa9900bc31fec957bb001115acac7b (diff)
Make EstimateMedianVal smarter about small failures.
Instead of stopping if it encounters a "sufficient" number of transactions which don't meet the threshold for being confirmed within the target, it keeps looking to add more transactions to see if there is a temporary blip in the data. This allows a smaller number of required data points.
Diffstat (limited to 'src/policy/fees.cpp')
-rw-r--r--src/policy/fees.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
index 0e9fb4dfea..03a0df4610 100644
--- a/src/policy/fees.cpp
+++ b/src/policy/fees.cpp
@@ -231,11 +231,9 @@ double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,
double curPct = nConf / (totalNum + extraNum);
// Check to see if we are no longer getting confirmed at the success rate
- if (requireGreater && curPct < successBreakPoint)
- break;
- if (!requireGreater && curPct > successBreakPoint)
- break;
-
+ if ((requireGreater && curPct < successBreakPoint) || (!requireGreater && curPct > successBreakPoint)) {
+ continue;
+ }
// Otherwise update the cumulative stats, and the bucket variables
// and reset the counters
else {