mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge #9010: Split up AppInit2 into multiple phases, daemonize after datadir lock errors
deec83finit: Get rid of fServer flag (Wladimir J. van der Laan)16ca0bfinit: Try to aquire datadir lock before and after daemonization (Wladimir J. van der Laan)0cc8b6binit: Split up AppInit2 into multiple phases (Wladimir J. van der Laan)
This commit is contained in:
@@ -128,6 +128,26 @@ bool AppInit(int argc, char* argv[])
|
||||
fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// -server defaults to true for bitcoind but not for the GUI so do this here
|
||||
SoftSetBoolArg("-server", true);
|
||||
// Set this early so that parameter interactions go to console
|
||||
InitLogging();
|
||||
InitParameterInteraction();
|
||||
if (!AppInitBasicSetup())
|
||||
{
|
||||
// InitError will have been called with detailed error, which ends up on console
|
||||
exit(1);
|
||||
}
|
||||
if (!AppInitParameterInteraction())
|
||||
{
|
||||
// InitError will have been called with detailed error, which ends up on console
|
||||
exit(1);
|
||||
}
|
||||
if (!AppInitSanityChecks())
|
||||
{
|
||||
// InitError will have been called with detailed error, which ends up on console
|
||||
exit(1);
|
||||
}
|
||||
if (GetBoolArg("-daemon", false))
|
||||
{
|
||||
#if HAVE_DECL_DAEMON
|
||||
@@ -143,12 +163,8 @@ bool AppInit(int argc, char* argv[])
|
||||
return false;
|
||||
#endif // HAVE_DECL_DAEMON
|
||||
}
|
||||
SoftSetBoolArg("-server", true);
|
||||
|
||||
// Set this early so that parameter interactions go to console
|
||||
InitLogging();
|
||||
InitParameterInteraction();
|
||||
fRet = AppInit2(threadGroup, scheduler);
|
||||
fRet = AppInitMain(threadGroup, scheduler);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
PrintExceptionContinue(&e, "AppInit()");
|
||||
|
||||
Reference in New Issue
Block a user