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;