mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
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.
This commit is contained in:
parent
d3e30bca1b
commit
1ba43cc0ec
@ -231,11 +231,9 @@ double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,
|
|||||||
double curPct = nConf / (totalNum + extraNum);
|
double curPct = nConf / (totalNum + extraNum);
|
||||||
|
|
||||||
// Check to see if we are no longer getting confirmed at the success rate
|
// Check to see if we are no longer getting confirmed at the success rate
|
||||||
if (requireGreater && curPct < successBreakPoint)
|
if ((requireGreater && curPct < successBreakPoint) || (!requireGreater && curPct > successBreakPoint)) {
|
||||||
break;
|
continue;
|
||||||
if (!requireGreater && curPct > successBreakPoint)
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
// Otherwise update the cumulative stats, and the bucket variables
|
// Otherwise update the cumulative stats, and the bucket variables
|
||||||
// and reset the counters
|
// and reset the counters
|
||||||
else {
|
else {
|
||||||
|
@ -88,8 +88,8 @@ private:
|
|||||||
static constexpr double SUCCESS_PCT = .85;
|
static constexpr double SUCCESS_PCT = .85;
|
||||||
static constexpr double DOUBLE_SUCCESS_PCT = .95;
|
static constexpr double DOUBLE_SUCCESS_PCT = .95;
|
||||||
|
|
||||||
/** Require an avg of 1 tx in the combined feerate bucket per block to have stat significance */
|
/** Require an avg of 0.1 tx in the combined feerate bucket per block to have stat significance */
|
||||||
static constexpr double SUFFICIENT_FEETXS = 1;
|
static constexpr double SUFFICIENT_FEETXS = 0.1;
|
||||||
|
|
||||||
/** Minimum and Maximum values for tracking feerates
|
/** Minimum and Maximum values for tracking feerates
|
||||||
* The MIN_BUCKET_FEERATE should just be set to the lowest reasonable feerate we
|
* The MIN_BUCKET_FEERATE should just be set to the lowest reasonable feerate we
|
||||||
|
Loading…
Reference in New Issue
Block a user