Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,246 Lines • ▼ Show 20 Lines | void InitParameterInteraction() { | ||||
} | } | ||||
} | } | ||||
static std::string ResolveErrMsg(const char *const optname, | static std::string ResolveErrMsg(const char *const optname, | ||||
const std::string &strBind) { | const std::string &strBind) { | ||||
return strprintf(_("Cannot resolve -%s address: '%s'"), optname, strBind); | return strprintf(_("Cannot resolve -%s address: '%s'"), optname, strBind); | ||||
} | } | ||||
void ParameterSetup() { | |||||
InitLogging(); | |||||
InitParameterInteraction(); | |||||
} | |||||
void InitLogging() { | void InitLogging() { | ||||
BCLog::Logger &logger = GetLogger(); | BCLog::Logger &logger = GetLogger(); | ||||
logger.m_print_to_console = gArgs.GetBoolArg("-printtoconsole", false); | logger.m_print_to_console = gArgs.GetBoolArg("-printtoconsole", false); | ||||
logger.m_log_timestamps = | logger.m_log_timestamps = | ||||
gArgs.GetBoolArg("-logtimestamps", DEFAULT_LOGTIMESTAMPS); | gArgs.GetBoolArg("-logtimestamps", DEFAULT_LOGTIMESTAMPS); | ||||
logger.m_log_time_micros = | logger.m_log_time_micros = | ||||
gArgs.GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS); | gArgs.GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS); | ||||
▲ Show 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | bool AppInitLockDataDirectory() { | ||||
// printing a message to console. | // printing a message to console. | ||||
if (!LockDataDirectory(false)) { | if (!LockDataDirectory(false)) { | ||||
// Detailed error printed inside LockDataDirectory | // Detailed error printed inside LockDataDirectory | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool AppInitBase(Config &config, RPCServer &rpcServer) { | |||||
if (!AppInitBasicSetup()) { | |||||
return false; | |||||
} | |||||
if (!AppInitParameterInteraction(config, rpcServer)) { | |||||
return false; | |||||
} | |||||
if (!AppInitSanityChecks()) { | |||||
return false; | |||||
} | |||||
if (!AppInitLockDataDirectory()) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
bool AppInitMain(Config &config, | bool AppInitMain(Config &config, | ||||
HTTPRPCRequestProcessor &httpRPCRequestProcessor, | HTTPRPCRequestProcessor &httpRPCRequestProcessor, | ||||
boost::thread_group &threadGroup, CScheduler &scheduler) { | boost::thread_group &threadGroup, CScheduler &scheduler) { | ||||
// Step 4a: application initialization | // Step 4a: application initialization | ||||
const CChainParams &chainparams = config.GetChainParams(); | const CChainParams &chainparams = config.GetChainParams(); | ||||
#ifndef WIN32 | #ifndef WIN32 | ||||
CreatePidFile(GetPidFile(), getpid()); | CreatePidFile(GetPidFile(), getpid()); | ||||
▲ Show 20 Lines • Show All 601 Lines • Show Last 20 Lines |