diff --git a/src/init.cpp b/src/init.cpp index b38987f3c8..cb5a1950ed 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2654,11 +2654,17 @@ bool AppInitMain(Config &config, RPCServer &rpcServer, uiInterface.InitMessage(_("Loading block index...").translated); + const int64_t load_block_index_start_time = GetTimeMillis(); + if (!LoadChainstate(fLoaded, strLoadError, fReset, chainman, node, fPruneMode, config, args, fReindexChainState, nBlockTreeDBCache, nCoinDBCache, nCoinCacheUsage)) { return false; } + if (fLoaded) { + LogPrintf(" block index %15dms\n", + GetTimeMillis() - load_block_index_start_time); + } if (!fLoaded && !ShutdownRequested()) { // first suggest a reindex diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 2e5a8f7880..6b90ca5691 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -31,7 +31,6 @@ bool LoadChainstate(bool &fLoaded, bilingual_str &strLoadError, bool fReset, do { bool failed_verification = false; - const int64_t load_block_index_start_time = GetTimeMillis(); try { LOCK(cs_main); chainman.InitializeChainstate(Assert(node.mempool.get())); @@ -215,8 +214,6 @@ bool LoadChainstate(bool &fLoaded, bilingual_str &strLoadError, bool fReset, if (!failed_verification) { fLoaded = true; - LogPrintf(" block index %15dms\n", - GetTimeMillis() - load_block_index_start_time); } } while (false);