From 2dcd7b4ec76dc23bf901f4517703758c3fa377ba Mon Sep 17 00:00:00 2001 From: mruddy <6440430+mruddy@users.noreply.github.com> Date: Sat, 30 Jun 2018 07:25:25 -0400 Subject: [PATCH] logging: avoid nStart may be used uninitialized in AppInitMain warning --- src/init.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 5e4527798..f5bb4f4ac 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1305,8 +1305,6 @@ bool AppInitMain() return InitError(_("Unable to start HTTP server. See debug log for details.")); } - int64_t nStart; - // ********************************************************* Step 5: verify wallet database integrity if (!g_wallet_init_interface.Verify()) return false; @@ -1458,8 +1456,8 @@ bool AppInitMain() LOCK(cs_main); - nStart = GetTimeMillis(); do { + const int64_t load_block_index_start_time = GetTimeMillis(); try { UnloadBlockIndex(); pcoinsTip.reset(); @@ -1582,6 +1580,7 @@ bool AppInitMain() } fLoaded = true; + LogPrintf(" block index %15dms\n", GetTimeMillis() - load_block_index_start_time); } while(false); if (!fLoaded && !fRequestShutdown) { @@ -1612,9 +1611,6 @@ bool AppInitMain() LogPrintf("Shutdown requested. Exiting.\n"); return false; } - if (fLoaded) { - LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart); - } fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION);