Browse Source

Init: Remove redundant exit(EXIT_FAILURE) instances and replace with return false

0.16
donaloconnor 7 years ago
parent
commit
b296bf1496
  1. 10
      src/bitcoind.cpp

10
src/bitcoind.cpp

@ -120,7 +120,7 @@ bool AppInit(int argc, char* argv[])
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; i++) {
if (!IsSwitchChar(argv[i][0])) { if (!IsSwitchChar(argv[i][0])) {
fprintf(stderr, "Error: Command line contains unexpected token '%s', see bitcoind -h for a list of options.\n", argv[i]); fprintf(stderr, "Error: Command line contains unexpected token '%s', see bitcoind -h for a list of options.\n", argv[i]);
exit(EXIT_FAILURE); return false;
} }
} }
@ -132,17 +132,17 @@ bool AppInit(int argc, char* argv[])
if (!AppInitBasicSetup()) if (!AppInitBasicSetup())
{ {
// InitError will have been called with detailed error, which ends up on console // InitError will have been called with detailed error, which ends up on console
exit(EXIT_FAILURE); return false;
} }
if (!AppInitParameterInteraction()) if (!AppInitParameterInteraction())
{ {
// InitError will have been called with detailed error, which ends up on console // InitError will have been called with detailed error, which ends up on console
exit(EXIT_FAILURE); return false;
} }
if (!AppInitSanityChecks()) if (!AppInitSanityChecks())
{ {
// InitError will have been called with detailed error, which ends up on console // InitError will have been called with detailed error, which ends up on console
exit(EXIT_FAILURE); return false;
} }
if (gArgs.GetBoolArg("-daemon", false)) if (gArgs.GetBoolArg("-daemon", false))
{ {
@ -163,7 +163,7 @@ bool AppInit(int argc, char* argv[])
if (!AppInitLockDataDirectory()) if (!AppInitLockDataDirectory())
{ {
// If locking the data directory failed, exit immediately // If locking the data directory failed, exit immediately
exit(EXIT_FAILURE); return false;
} }
fRet = AppInitMain(threadGroup, scheduler); fRet = AppInitMain(threadGroup, scheduler);
} }

Loading…
Cancel
Save