Show reindex state in metrics

This commit is contained in:
gladcow 2020-02-20 18:38:57 +03:00
parent 2a6be9fd19
commit 7bdf64f319
1 changed files with 5 additions and 2 deletions

View File

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