During initial blocks download, also report the number of headers

This commit is contained in:
Solar Designer 2019-04-02 16:13:39 +02:00 committed by Jack Grigg
parent ed3b473ec6
commit fad004114a
1 changed files with 8 additions and 1 deletions

View File

@ -291,10 +291,17 @@ int printStats(bool mining)
int downloadPercent = nSizeReindexed * 100 / nFullSizeToReindex;
std::cout << " " << _("Reindexing blocks") << " | " << DisplaySize(nSizeReindexed) << " / " << DisplaySize(nFullSizeToReindex) << " (" << downloadPercent << "%, " << height << " " << _("blocks") << ")" << std::endl;
} else {
int nHeaders = currentHeadersHeight;
if (nHeaders < 0)
nHeaders = 0;
int netheight = currentHeadersHeight == -1 || currentHeadersTime == 0 ?
0 : EstimateNetHeight(params, currentHeadersHeight, currentHeadersTime);
if (netheight < nHeaders)
netheight = nHeaders;
if (netheight <= 0)
netheight = 1;
int downloadPercent = height * 100 / netheight;
std::cout << " " << _("Downloading blocks") << " | " << height << " / ~" << netheight << " (" << downloadPercent << "%)" << std::endl;
std::cout << " " << _("Downloading blocks") << " | " << height << " (" << nHeaders << " " << _("headers") << ") / ~" << netheight << " (" << downloadPercent << "%)" << std::endl;
}
} else {
std::cout << " " << _("Block height") << " | " << height << std::endl;