reverse conditional, replace get_value_or(0) calls
This commit is contained in:
parent
5bea8b76ab
commit
9582e258ba
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue