Avoid printing incorrect block indexing time due to uninitialized variable #10714

Merged
merged 1 commit into from Jul 12, 2017

Conversation

Projects
None yet
6 participants
Contributor

practicalswift commented Jul 2, 2017

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);
                                                        ^

In this fix I've assumed that block indexing time is only relevant to print in case of fLoaded. Let me know if that assumption is incorrect.

@practicalswift practicalswift 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);
                                                        ^
959dd87
Contributor

TheBlueMatt commented Jul 7, 2017

utACK

@gmaxwell

utACK looks like the correct fix to me

Member

jnewbery commented Jul 10, 2017

Tested ACK 959dd87.

@sipa sipa merged commit 959dd87 into bitcoin:master Jul 12, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sipa sipa added a commit that referenced this pull request Jul 12, 2017

@sipa sipa Merge #10714: Avoid printing incorrect block indexing time due to uni…
…nitialized variable


959dd87 Avoid printing incorrect block indexing time due to uninitialized variable (practicalswift)

Tree-SHA512: a76e43c3ffa734ed5c7eadf363f345f268aa0e6ce775aba8f856fe3bbc82f240dc7c734c5ca3ac500a12eb41fae00623413e79f484d5acf809b6e400851d771d
2a09a38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment