Skip to content

Commit 959dd87

Browse files
Avoid printing incorrect block indexing time due to uninitialized variable
Fixes: init.cpp: In function ‘bool AppInitMain(boost::thread_group&, CScheduler&)’: init.cpp:1499:56: warning: ‘nStart’ may be used uninitialized in this function [-Wmaybe-uninitialized] LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart); ^
1 parent 2935b46 commit 959dd87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/init.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
14961496
LogPrintf("Shutdown requested. Exiting.\n");
14971497
return false;
14981498
}
1499-
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
1499+
if (fLoaded) {
1500+
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
1501+
}
15001502

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

0 commit comments

Comments
 (0)