init: Factor out AppInitLockDataDirectory and fix startup core dump issue#10832
Conversation
meshcollider
left a comment
There was a problem hiding this comment.
utACK although you could refactor braces onto same line as if-statements in baseInitialize (or is it better not to mix refactor with changes?)
src/init.cpp
Outdated
There was a problem hiding this comment.
Why not just return LockDataDirectory(false); without the if statement? If statement seems unnecessary
There was a problem hiding this comment.
The comments seem useful.
There was a problem hiding this comment.
Yeah I mean you could keep the comments and just remove the if statement, if(something) then true else false make things a bit less clear IMO. But this is a simple case, not a big deal either way
Could do that, but I'd prefer to not increase the scope of this to code style enforcement (of existing code). I just want to fix this issue. |
|
utACK d4c027dd4acb77d2c5ee38ae883110abc3796d52, thanks. (modulo not sure I know enough about the Qt init process to say this is definitely right). |
Alternative to bitcoin#10818, alternative solution to bitcoin#10815. After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called. Changes the GUI and bitcoind code to consistently do this.
d4c027d to
dba485d
Compare
|
Squashed ceec6cb 26fa3fc d4c027d → dba485d. |
…up core dump issue dba485d init: Factor out AppInitLockDataDirectory (Wladimir J. van der Laan) Pull request description: Alternative to #10818, alternative solution to #10815. After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called. Changes the GUI and bitcoind code to consistently do this. Tree-SHA512: 393e1a0ae05eb8e791025069e3ac4f6f3cdeb459ec63feda85d01cf6696ab3fed7632b6a0ac3641b8c7015af51d46756b5bba77f5e5f0c446f0c2dea58bbc92e
…x startup core dump issue dba485d init: Factor out AppInitLockDataDirectory (Wladimir J. van der Laan) Pull request description: Alternative to bitcoin#10818, alternative solution to bitcoin#10815. After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called. Changes the GUI and bitcoind code to consistently do this. Tree-SHA512: 393e1a0ae05eb8e791025069e3ac4f6f3cdeb459ec63feda85d01cf6696ab3fed7632b6a0ac3641b8c7015af51d46756b5bba77f5e5f0c446f0c2dea58bbc92e
Alternative to #10818, alternative solution to #10815.
After this change: All the AppInit steps before and inclusive AppInitLockDataDirectory must not have Shutdown() called in case of failure. Only when AppInitMain fails, Shutdown should be called.
Changes the GUI and bitcoind code to consistently do this.