diff options
author | Alex Morcos <morcos@chaincode.com> | 2017-03-10 16:57:40 -0500 |
---|---|---|
committer | Alex Morcos <morcos@chaincode.com> | 2017-05-10 11:47:45 -0400 |
commit | 5f1f0c64905491fea4ba50c0a8eb68fa59d65411 (patch) | |
tree | ba3d8fcf85daea9a7d7f03ec4fce5a9b2809bb2f /src/policy/fees.h | |
parent | aa19b8ea44b292cd612c4ce01e08c83324fa8296 (diff) |
Historical block span
Store in fee estimate file the block span for which we were tracking estimates, so we know what targets we can successfully evaluate with the data in the file. When restarting use either this historical block span to set valid range of targets until our current span of tracking estimates is just as long.
Diffstat (limited to 'src/policy/fees.h')
-rw-r--r-- | src/policy/fees.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/policy/fees.h b/src/policy/fees.h index 3184aa08ab..1f752415e7 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -98,6 +98,8 @@ private: static constexpr unsigned int MED_BLOCK_CONFIRMS = 48; /** Track confirm delays up to 1008 blocks for longer decay */ static constexpr unsigned int LONG_BLOCK_CONFIRMS = 1008; + /** Historical estimates that are older than this aren't valid */ + static const unsigned int OLDEST_ESTIMATE_HISTORY = 6 * 1008; /** Decay of .962 is a half-life of 18 blocks or about 3 hours */ static constexpr double SHORT_DECAY = .962; @@ -205,6 +207,9 @@ private: double estimateCombinedFee(unsigned int confTarget, double successThreshold, bool checkShorterHorizon) const; double estimateConservativeFee(unsigned int doubleTarget) const; + unsigned int BlockSpan() const; + unsigned int HistoricalBlockSpan() const; + unsigned int MaxUsableEstimate() const; }; class FeeFilterRounder |