Skip to content

Commit 2dcd7b4

Browse files
committed
logging: avoid nStart may be used uninitialized in AppInitMain warning
1 parent a6ed99a commit 2dcd7b4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/init.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,6 @@ bool AppInitMain()
13051305
return InitError(_("Unable to start HTTP server. See debug log for details."));
13061306
}
13071307

1308-
int64_t nStart;
1309-
13101308
// ********************************************************* Step 5: verify wallet database integrity
13111309
if (!g_wallet_init_interface.Verify()) return false;
13121310

@@ -1458,8 +1456,8 @@ bool AppInitMain()
14581456

14591457
LOCK(cs_main);
14601458

1461-
nStart = GetTimeMillis();
14621459
do {
1460+
const int64_t load_block_index_start_time = GetTimeMillis();
14631461
try {
14641462
UnloadBlockIndex();
14651463
pcoinsTip.reset();
@@ -1582,6 +1580,7 @@ bool AppInitMain()
15821580
}
15831581

15841582
fLoaded = true;
1583+
LogPrintf(" block index %15dms\n", GetTimeMillis() - load_block_index_start_time);
15851584
} while(false);
15861585

15871586
if (!fLoaded && !fRequestShutdown) {
@@ -1612,9 +1611,6 @@ bool AppInitMain()
16121611
LogPrintf("Shutdown requested. Exiting.\n");
16131612
return false;
16141613
}
1615-
if (fLoaded) {
1616-
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
1617-
}
16181614

16191615
fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
16201616
CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION);

0 commit comments

Comments
 (0)