diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-01-03 18:44:02 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-03 18:38:31 +0100 |
commit | aaaa9878405f3f38f4f61c00feca110d7f9ca481 (patch) | |
tree | 08c0b91fcc058f01d86f0a6d7de3b4d334646de9 /src/policy | |
parent | fa39cdd072c91eac70cda04b8b26681611f94cb7 (diff) |
refactor: Use C++17 std::array deduction for ALL_FEE_ESTIMATE_HORIZONS
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/fees.h | 13 |
1 files changed, 10 insertions, 3 deletions
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 <random.h> #include <sync.h> +#include <array> #include <map> #include <memory> #include <string> @@ -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); |