From 9582e258ba7b977cfb035aeadf07c80d7a8f7de7 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Mon, 4 Nov 2019 13:31:00 -0300 Subject: [PATCH] reverse conditional, replace get_value_or(0) calls --- src/metrics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/metrics.cpp b/src/metrics.cpp index 3f950d25e..bf7f73ec5 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -277,15 +277,15 @@ int printStats(bool mining) auto secondsLeft = SecondsLeftToNextEpoch(params, height); std::string strUpgradeTime; - if (secondsLeft == boost::none) { - strUpgradeTime = "Unknown"; - } - else { - auto nextHeight = NextActivationHeight(height, params).get_value_or(0); - auto nextBranch = NextEpoch(height, params).get_value_or(0); + if (secondsLeft) { + auto nextHeight = NextActivationHeight(height, params).value(); + auto nextBranch = NextEpoch(height, params).value(); strUpgradeTime = strprintf(_("%s at block height %d, in around %s"), NetworkUpgradeInfo[nextBranch].strName, nextHeight, DisplayDuration(secondsLeft.value(), DurationFormat::REDUCED)); } + else { + strUpgradeTime = "Unknown"; + } std::cout << " " << _("Next upgrade") << " | " << strUpgradeTime << std::endl; std::cout << " " << _("Connections") << " | " << connections << std::endl; std::cout << " " << _("Network solution rate") << " | " << netsolps << " Sol/s" << std::endl;