From 188f3254fc678dcd8feaab142831cf171db3e1e0 Mon Sep 17 00:00:00 2001 From: jeff-liang <46398134+jeff-liang@users.noreply.github.com> Date: Sat, 5 Jan 2019 08:19:20 -0500 Subject: [PATCH] Display which network the node is running on. Co-authored-by: Jeff Liang Signed-off-by: Daira Hopwood --- src/metrics.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/metrics.cpp b/src/metrics.cpp index 1fe7660b3..19a9f0f1a 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -109,6 +109,15 @@ double GetLocalSolPS() return miningTimer.rate(solutionTargetChecks); } +std::string WhichNetwork() +{ + if (GetBoolArg("-regtest", false)) + return "regtest "; + if (GetBoolArg("-testnet", false)) + return "testnet "; + return "mainnet "; +} + int EstimateNetHeight(const Consensus::Params& params, int currentHeadersHeight, int64_t currentHeadersTime) { int64_t now = GetAdjustedTime(); @@ -460,7 +469,7 @@ void ThreadShowMetricsScreen() std::cout << std::endl; // Thank you text - std::cout << _("Thank you for running a Zcash node!") << std::endl; + std::cout << _("Thank you for running a " + WhichNetwork() + "Zcash node!") << std::endl; std::cout << _("You're helping to strengthen the network and contributing to a social good :)") << std::endl; // Privacy notice text