Permalink
Browse files

Avoid printing incorrect block indexing time due to uninitialized var…

…iable

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);
                                                        ^
  • Loading branch information...
1 parent 2935b46 commit 959dd8781ed8982df06b52dd3cecc996cf30f76d @practicalswift practicalswift committed Jul 2, 2017
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/init.cpp
View
@@ -1496,7 +1496,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("Shutdown requested. Exiting.\n");
return false;
}
- LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
+ 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);

0 comments on commit 959dd87

Please sign in to comment.