Was getting the following compiler warning:
0init.cpp: In function ‘bool AppInitMain()’:
1init.cpp:1616:60: warning: ‘nStart’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2 LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
It’s ok without this PR, but this PR renames nStart
to load_block_index_start_time
, makes it const
, and also reduces the scope of the variable.
The logging line is moved such that the the time spent will be logged even if a shutdown is requested while the index is being loaded.
Having the log message output even when a shutdown is requested may be how this was intended to work before anyways. That could explain the leading space, as such a log message now looks like:
02018-06-30T11:34:05Z [0%]...[16%]...[33%]...[50%]... block index 25750ms
12018-06-30T11:34:17Z Shutdown requested. Exiting.