Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Jul 15, 2017

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.

Copy link
Contributor

@meshcollider meshcollider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return LockDataDirectory(false); without the if statement? If statement seems unnecessary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments seem useful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bitcoin bitcoin deleted a comment Jul 15, 2017
@bitcoin bitcoin deleted a comment Jul 15, 2017
@laanwj
Copy link
Member Author

laanwj commented Jul 15, 2017

utACK although you could refactor braces onto same line as if-statements in baseInitialize (or is it better not to mix refactor with changes?)

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.

@laanwj laanwj changed the title init: Factor out AppInitLockDataDirectory init: Factor out AppInitLockDataDirectory and fix startup core dump issue Jul 15, 2017
@TheBlueMatt
Copy link
Contributor

utACK d4c027dd4acb77d2c5ee38ae883110abc3796d52, thanks. (modulo not sure I know enough about the Qt init process to say this is definitely right).

Copy link
Contributor

@gmaxwell gmaxwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK

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.
@laanwj laanwj force-pushed the 2017_07_appinitlockdatadirectory branch from d4c027d to dba485d Compare July 17, 2017 12:57
@laanwj
Copy link
Member Author

laanwj commented Jul 17, 2017

Squashed ceec6cb 26fa3fc d4c027d → dba485d.

@laanwj laanwj merged commit dba485d into bitcoin:master Jul 17, 2017
laanwj added a commit that referenced this pull request Jul 17, 2017
…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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 2, 2019
…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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants