Browse Source
Metrics - Don't exclaim unless > 1
"You have validated 0 transactions!" sounds a little less enthusiastic that intended. Also, only says "1 transaction".
pull/4/head
Scott
8 years ago
committed by
Jack Grigg
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
1 changed files with
9 additions and
1 deletions
-
src/metrics.cpp
|
|
@ -94,6 +94,7 @@ int printMetrics(size_t cols, int64_t nStart, bool mining) |
|
|
|
int hours = (uptime - (days * 24 * 60 * 60)) / (60 * 60); |
|
|
|
int minutes = (uptime - (((days * 24) + hours) * 60 * 60)) / 60; |
|
|
|
int seconds = uptime - (((((days * 24) + hours) * 60) + minutes) * 60); |
|
|
|
int validatedCount = 0; |
|
|
|
|
|
|
|
// Display uptime
|
|
|
|
std::string duration; |
|
|
@ -110,7 +111,14 @@ int printMetrics(size_t cols, int64_t nStart, bool mining) |
|
|
|
std::cout << strDuration << std::endl; |
|
|
|
lines += (strDuration.size() / cols); |
|
|
|
|
|
|
|
std::cout << "- " << strprintf(_("You have validated %d transactions!"), transactionsValidated.get()) << std::endl; |
|
|
|
validatedCount = transactionsValidated.get(); |
|
|
|
if (validatedCount > 1) { |
|
|
|
std::cout << "- " << strprintf(_("You have validated %d transactions!"), validatedCount) << std::endl; |
|
|
|
} else if (validatedCount == 1) { |
|
|
|
std::cout << "- " << strprintf(_("You have validated %d transaction."), validatedCount) << std::endl; |
|
|
|
} else { |
|
|
|
std::cout << "- " << strprintf(_("You have validated %d transactions."), validatedCount) << std::endl; |
|
|
|
} |
|
|
|
|
|
|
|
if (mining) { |
|
|
|
double solps = uptime > 0 ? (double)solutionTargetChecks.get() / uptime : 0; |
|
|
|