logging: avoid nStart may be used uninitialized in AppInitMain warning

This commit is contained in:
mruddy 2018-06-30 07:25:25 -04:00
parent a6ed99a1e6
commit 2dcd7b4ec7

View file

@ -1305,8 +1305,6 @@ bool AppInitMain()
return InitError(_("Unable to start HTTP server. See debug log for details.")); return InitError(_("Unable to start HTTP server. See debug log for details."));
} }
int64_t nStart;
// ********************************************************* Step 5: verify wallet database integrity // ********************************************************* Step 5: verify wallet database integrity
if (!g_wallet_init_interface.Verify()) return false; if (!g_wallet_init_interface.Verify()) return false;
@ -1458,8 +1456,8 @@ bool AppInitMain()
LOCK(cs_main); LOCK(cs_main);
nStart = GetTimeMillis();
do { do {
const int64_t load_block_index_start_time = GetTimeMillis();
try { try {
UnloadBlockIndex(); UnloadBlockIndex();
pcoinsTip.reset(); pcoinsTip.reset();
@ -1582,6 +1580,7 @@ bool AppInitMain()
} }
fLoaded = true; fLoaded = true;
LogPrintf(" block index %15dms\n", GetTimeMillis() - load_block_index_start_time);
} while(false); } while(false);
if (!fLoaded && !fRequestShutdown) { if (!fLoaded && !fRequestShutdown) {
@ -1612,9 +1611,6 @@ bool AppInitMain()
LogPrintf("Shutdown requested. Exiting.\n"); LogPrintf("Shutdown requested. Exiting.\n");
return false; return false;
} }
if (fLoaded) {
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
}
fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION); CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION);