diff --git a/src/init.cpp b/src/init.cpp index b42dfb590c..fefe7845d1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1865,6 +1865,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) uiInterface.InitMessage(_("Loading block index…").translated); + const auto load_block_index_start_time{SteadyClock::now()}; bool rv = LoadChainstate(fLoaded, strLoadError, fReset, @@ -1879,6 +1880,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) nCoinDBCache, nCoinCacheUsage); if (!rv) return false; + if (fLoaded) { + LogPrintf(" block index %15dms\n", Ticks(SteadyClock::now() - 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 727a91a328..e8dd229d42 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -7,7 +7,7 @@ #include // for CChainParams #include // for DeploymentActiveAfter #include // for RPCNotifyBlockChange -#include // for GetTime, GetTimeMillis +#include // for GetTime #include // for bilingual_str #include // for CleanupBlockRevFiles, fHavePruned, fReindex #include // for NodeContext @@ -43,7 +43,6 @@ bool LoadChainstate(bool& fLoaded, }; do { - const auto load_block_index_start_time{SteadyClock::now()}; try { LOCK(cs_main); @@ -315,7 +314,6 @@ bool LoadChainstate(bool& fLoaded, if (!failed_verification) { fLoaded = true; - LogPrintf(" block index %15dms\n", Ticks(SteadyClock::now() - load_block_index_start_time)); } } while(false); return true;