From aaaa9878405f3f38f4f61c00feca110d7f9ca481 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 3 Jan 2021 18:44:02 +0100 Subject: refactor: Use C++17 std::array deduction for ALL_FEE_ESTIMATE_HORIZONS --- src/policy/fees.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/policy') diff --git a/src/policy/fees.h b/src/policy/fees.h index dd9f530c99..c444d71a31 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -25,9 +26,15 @@ class TxConfirmStats; /* Identifier for each of the 3 different TxConfirmStats which will track * history over different time horizons. */ enum class FeeEstimateHorizon { - SHORT_HALFLIFE = 0, - MED_HALFLIFE = 1, - LONG_HALFLIFE = 2 + SHORT_HALFLIFE, + MED_HALFLIFE, + LONG_HALFLIFE, +}; + +static constexpr auto ALL_FEE_ESTIMATE_HORIZONS = std::array{ + FeeEstimateHorizon::SHORT_HALFLIFE, + FeeEstimateHorizon::MED_HALFLIFE, + FeeEstimateHorizon::LONG_HALFLIFE, }; std::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon); -- cgit v1.2.3