mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02: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:
commit
a143b88dbd
6 changed files with 121 additions and 35 deletions
|
|
@ -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()");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue