diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -2385,15 +2385,14 @@ nCoinCacheUsage * (1.0 / 1024 / 1024), nMempoolSizeMax * (1.0 / 1024 / 1024)); - int64_t nStart = 0; bool fLoaded = false; while (!fLoaded && !ShutdownRequested()) { const bool fReset = fReindex; std::string strLoadError; uiInterface.InitMessage(_("Loading block index...").translated); - nStart = GetTimeMillis(); do { + const int64_t load_block_index_start_time = GetTimeMillis(); try { LOCK(cs_main); UnloadBlockIndex(); @@ -2560,6 +2559,8 @@ } fLoaded = true; + LogPrintf(" block index %15dms\n", + GetTimeMillis() - load_block_index_start_time); } while (false); if (!fLoaded && !ShutdownRequested()) { @@ -2595,9 +2596,6 @@ LogPrintf("Shutdown requested. Exiting.\n"); return false; } - if (fLoaded) { - LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart); - } // Encoded addresses using cashaddr instead of base58. // We do this by default to avoid confusion with BTC addresses.