From 7bdf64f319f40e23436248d0a48694ffbe4eb320 Mon Sep 17 00:00:00 2001 From: gladcow Date: Thu, 20 Feb 2020 18:38:57 +0300 Subject: [PATCH] Show reindex state in metrics --- src/metrics.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/metrics.cpp b/src/metrics.cpp index d2b73a9ea..84990dfff 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -267,10 +267,13 @@ int printStats(bool mining) auto localsolps = GetLocalSolPS(); if (IsInitialBlockDownload(Params())) { - int netheight = currentHeadersHeight == -1 || currentHeadersTime == 0 ? + int netheight = currentHeadersHeight == -1 || currentHeadersTime == 0 ? 0 : EstimateNetHeight(params, currentHeadersHeight, currentHeadersTime); int downloadPercent = height * 100 / netheight; - std::cout << " " << _("Downloading blocks") << " | " << height << " / ~" << netheight << " (" << downloadPercent << "%)" << std::endl; + if (fReindex) + std::cout << " " << _("Reindexing blocks") << " | " << height << " / ~" << netheight << " (" << downloadPercent << "%)" << std::endl; + else + std::cout << " " << _("Downloading blocks") << " | " << height << " / ~" << netheight << " (" << downloadPercent << "%)" << std::endl; } else { std::cout << " " << _("Block height") << " | " << height << std::endl; }