mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
init: Factor out AppInitLockDataDirectory
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.
This commit is contained in:
@@ -159,7 +159,12 @@ bool AppInit(int argc, char* argv[])
|
||||
return false;
|
||||
#endif // HAVE_DECL_DAEMON
|
||||
}
|
||||
|
||||
// Lock data directory after daemonization
|
||||
if (!AppInitLockDataDirectory())
|
||||
{
|
||||
// If locking the data directory failed, exit immediately
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fRet = AppInitMain(threadGroup, scheduler);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
|
||||
Reference in New Issue
Block a user