Change API to estimaterawfee

Report results for all 3 possible time horizons instead of specifying time horizon as an argument.
This commit is contained in:
Alex Morcos
2017-06-06 13:08:27 -04:00
parent 9edda0c5f5
commit 9c85b91dc1
5 changed files with 68 additions and 51 deletions

View File

@@ -16,6 +16,19 @@
static constexpr double INF_FEERATE = 1e99;
std::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon) {
static const std::map<FeeEstimateHorizon, std::string> horizon_strings = {
{FeeEstimateHorizon::SHORT_HALFLIFE, "short"},
{FeeEstimateHorizon::MED_HALFLIFE, "medium"},
{FeeEstimateHorizon::LONG_HALFLIFE, "long"},
};
auto horizon_string = horizon_strings.find(horizon);
if (horizon_string == horizon_strings.end()) return "unknown";
return horizon_string->second;
}
std::string StringForFeeReason(FeeReason reason) {
static const std::map<FeeReason, std::string> fee_reason_strings = {
{FeeReason::NONE, "None"},