aboutsummaryrefslogtreecommitdiff
path: root/src/policy/fees.h
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-04-03 11:31:27 -0400
committerAlex Morcos <morcos@chaincode.com>2017-05-10 11:47:45 -0400
commit3ee76d6de5c8f8705c4b9bbcc75da0df4d42c966 (patch)
tree73e4c35a931df13e5b8300e0fd983ebc26e00044 /src/policy/fees.h
parent5f1f0c64905491fea4ba50c0a8eb68fa59d65411 (diff)
Introduce a scale factor
For the per confirmation number tracking of data, introduce a scale factor so that in the longer horizones confirmations are bucketed together at a resolution of the scale. (instead of 1008 individual data points for each fee bucket, have 42 data points each covering 24 different confirmation values.. (1-24), (25-48), etc.. )
Diffstat (limited to 'src/policy/fees.h')
-rw-r--r--src/policy/fees.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/policy/fees.h b/src/policy/fees.h
index 1f752415e7..45356d62f6 100644
--- a/src/policy/fees.h
+++ b/src/policy/fees.h
@@ -82,6 +82,7 @@ struct EstimationResult
EstimatorBucket pass;
EstimatorBucket fail;
double decay;
+ unsigned int scale;
};
/**
@@ -93,11 +94,14 @@ class CBlockPolicyEstimator
{
private:
/** Track confirm delays up to 12 blocks medium decay */
- static constexpr unsigned int SHORT_BLOCK_CONFIRMS = 12;
+ static constexpr unsigned int SHORT_BLOCK_PERIODS = 12;
+ static constexpr unsigned int SHORT_SCALE = 1;
/** Track confirm delays up to 48 blocks medium decay */
- static constexpr unsigned int MED_BLOCK_CONFIRMS = 48;
+ static constexpr unsigned int MED_BLOCK_PERIODS = 24;
+ static constexpr unsigned int MED_SCALE = 2;
/** Track confirm delays up to 1008 blocks for longer decay */
- static constexpr unsigned int LONG_BLOCK_CONFIRMS = 1008;
+ static constexpr unsigned int LONG_BLOCK_PERIODS = 42;
+ static constexpr unsigned int LONG_SCALE = 24;
/** Historical estimates that are older than this aren't valid */
static const unsigned int OLDEST_ESTIMATE_HISTORY = 6 * 1008;