reverse conditional, replace get_value_or(0) calls

This commit is contained in:
Alfredo Garcia 2019-11-04 13:31:00 -03:00
parent 5bea8b76ab
commit 9582e258ba
1 changed files with 6 additions and 6 deletions

View File

@ -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;