Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoind.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | try { | ||||
if (!args.ReadConfigFiles(error, true)) { | if (!args.ReadConfigFiles(error, true)) { | ||||
return InitError(Untranslated( | return InitError(Untranslated( | ||||
strprintf("Error reading configuration file: %s\n", error))); | strprintf("Error reading configuration file: %s\n", error))); | ||||
} | } | ||||
// Check for -chain, -testnet or -regtest parameter (Params() calls are | // Check for -chain, -testnet or -regtest parameter (Params() calls are | ||||
// only valid after this clause) | // only valid after this clause) | ||||
try { | try { | ||||
SelectParams(args.GetChainName()); | SelectParams(args.GetChainName()); | ||||
node.chain = interfaces::MakeChain(node, config.GetChainParams()); | |||||
} catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
return InitError(Untranslated(strprintf("%s\n", e.what()))); | return InitError(Untranslated(strprintf("%s\n", e.what()))); | ||||
} | } | ||||
// Make sure we create the net-specific data directory early on: if it | // Make sure we create the net-specific data directory early on: if it | ||||
// is new, this has a side effect of also creating | // is new, this has a side effect of also creating | ||||
// <datadir>/<net>/wallets/. | // <datadir>/<net>/wallets/. | ||||
// | // | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
#endif // HAVE_DECL_DAEMON | #endif // HAVE_DECL_DAEMON | ||||
} | } | ||||
// Lock data directory after daemonization | // Lock data directory after daemonization | ||||
if (!AppInitLockDataDirectory()) { | if (!AppInitLockDataDirectory()) { | ||||
// If locking the data directory failed, exit immediately | // If locking the data directory failed, exit immediately | ||||
return false; | return false; | ||||
} | } | ||||
fRet = AppInitMain(config, rpcServer, httpRPCRequestProcessor, node); | fRet = AppInitInterfaces(node) && | ||||
AppInitMain(config, rpcServer, httpRPCRequestProcessor, node); | |||||
} catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
PrintExceptionContinue(&e, "AppInit()"); | PrintExceptionContinue(&e, "AppInit()"); | ||||
} catch (...) { | } catch (...) { | ||||
PrintExceptionContinue(nullptr, "AppInit()"); | PrintExceptionContinue(nullptr, "AppInit()"); | ||||
} | } | ||||
if (!fRet) { | if (!fRet) { | ||||
Interrupt(node); | Interrupt(node); | ||||
Show All 20 Lines |