Skip to content

Commit 1ba43cc

Browse files
committed
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.
1 parent d3e30bc commit 1ba43cc

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/policy/fees.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,9 @@ double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,
231231
double curPct = nConf / (totalNum + extraNum);
232232

233233
// Check to see if we are no longer getting confirmed at the success rate
234-
if (requireGreater && curPct < successBreakPoint)
235-
break;
236-
if (!requireGreater && curPct > successBreakPoint)
237-
break;
238-
234+
if ((requireGreater && curPct < successBreakPoint) || (!requireGreater && curPct > successBreakPoint)) {
235+
continue;
236+
}
239237
// Otherwise update the cumulative stats, and the bucket variables
240238
// and reset the counters
241239
else {

src/policy/fees.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ class CBlockPolicyEstimator
8888
static constexpr double SUCCESS_PCT = .85;
8989
static constexpr double DOUBLE_SUCCESS_PCT = .95;
9090

91-
/** Require an avg of 1 tx in the combined feerate bucket per block to have stat significance */
92-
static constexpr double SUFFICIENT_FEETXS = 1;
91+
/** Require an avg of 0.1 tx in the combined feerate bucket per block to have stat significance */
92+
static constexpr double SUFFICIENT_FEETXS = 0.1;
9393

9494
/** Minimum and Maximum values for tracking feerates
9595
* The MIN_BUCKET_FEERATE should just be set to the lowest reasonable feerate we

0 commit comments

Comments
 (0)