Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 449 Lines • ▼ Show 20 Lines | strUsage += HelpMessageOpt( | ||||
DEFAULT_TXINDEX)); | DEFAULT_TXINDEX)); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-usecashaddr", _("Use Cash Address for destination encoding instead " | "-usecashaddr", _("Use Cash Address for destination encoding instead " | ||||
"of base58 (activate by default on Jan, 14)")); | "of base58 (activate by default on Jan, 14)")); | ||||
strUsage += HelpMessageGroup(_("Connection options:")); | strUsage += HelpMessageGroup(_("Connection options:")); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-addnode=<ip>", | "-addnode=<ip>", | ||||
_("Add a node to connect to and attempt to keep the connection open")); | _("Add a node to connect to and attempt to keep the connection open " | ||||
"(see the `addnode` RPC command help for more info)")); | |||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-banscore=<n>", | "-banscore=<n>", | ||||
strprintf( | strprintf( | ||||
_("Threshold for disconnecting misbehaving peers (default: %u)"), | _("Threshold for disconnecting misbehaving peers (default: %u)"), | ||||
DEFAULT_BANSCORE_THRESHOLD)); | DEFAULT_BANSCORE_THRESHOLD)); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-bantime=<n>", strprintf(_("Number of seconds to keep misbehaving " | "-bantime=<n>", strprintf(_("Number of seconds to keep misbehaving " | ||||
"peers from reconnecting (default: %u)"), | "peers from reconnecting (default: %u)"), | ||||
DEFAULT_MISBEHAVING_BANTIME)); | DEFAULT_MISBEHAVING_BANTIME)); | ||||
strUsage += HelpMessageOpt("-bind=<addr>", | strUsage += HelpMessageOpt("-bind=<addr>", | ||||
_("Bind to given address and always listen on " | _("Bind to given address and always listen on " | ||||
"it. Use [host]:port notation for IPv6")); | "it. Use [host]:port notation for IPv6")); | ||||
strUsage += | strUsage += HelpMessageOpt( | ||||
HelpMessageOpt("-connect=<ip>", | "-connect=<ip>", _("Connect only to the specified node(s); -connect=0 " | ||||
_("Connect only to the specified node(s); -noconnect or " | "disables automatic connections (the rules for this " | ||||
"-connect=0 alone to disable automatic connections")); | "peer are the same as for -addnode)")); | ||||
strUsage += HelpMessageOpt("-discover", | strUsage += HelpMessageOpt("-discover", | ||||
_("Discover own IP addresses (default: 1 when " | _("Discover own IP addresses (default: 1 when " | ||||
"listening and no -externalip or -proxy)")); | "listening and no -externalip or -proxy)")); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-dns", | "-dns", | ||||
_("Allow DNS lookups for -addnode, -seednode and -connect") + " " + | _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + | ||||
strprintf(_("(default: %d)"), DEFAULT_NAME_LOOKUP)); | strprintf(_("(default: %d)"), DEFAULT_NAME_LOOKUP)); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
▲ Show 20 Lines • Show All 771 Lines • ▼ Show 20 Lines | void InitLogging() { | ||||
fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS); | fLogIPs = gArgs.GetBoolArg("-logips", DEFAULT_LOGIPS); | ||||
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); | LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); | ||||
LogPrintf("%s version %s\n", CLIENT_NAME, FormatFullVersion()); | LogPrintf("%s version %s\n", CLIENT_NAME, FormatFullVersion()); | ||||
} | } | ||||
namespace { // Variables internal to initialization process only | namespace { // Variables internal to initialization process only | ||||
ServiceFlags nRelevantServices = NODE_NETWORK; | |||||
int nMaxConnections; | int nMaxConnections; | ||||
int nUserMaxConnections; | int nUserMaxConnections; | ||||
int nFD; | int nFD; | ||||
ServiceFlags nLocalServices = NODE_NETWORK; | ServiceFlags nLocalServices = NODE_NETWORK; | ||||
} // namespace | } // namespace | ||||
[[noreturn]] static void new_handler_terminate() { | [[noreturn]] static void new_handler_terminate() { | ||||
// Rather than throwing std::bad-alloc if allocation fails, terminate | // Rather than throwing std::bad-alloc if allocation fails, terminate | ||||
▲ Show 20 Lines • Show All 957 Lines • ▼ Show 20 Lines | #endif | ||||
Discover(); | Discover(); | ||||
// Map ports with UPnP | // Map ports with UPnP | ||||
MapPort(gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)); | MapPort(gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)); | ||||
CConnman::Options connOptions; | CConnman::Options connOptions; | ||||
connOptions.nLocalServices = nLocalServices; | connOptions.nLocalServices = nLocalServices; | ||||
connOptions.nRelevantServices = nRelevantServices; | |||||
connOptions.nMaxConnections = nMaxConnections; | connOptions.nMaxConnections = nMaxConnections; | ||||
connOptions.nMaxOutbound = | connOptions.nMaxOutbound = | ||||
std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections); | std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections); | ||||
connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS; | connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS; | ||||
connOptions.nMaxFeeler = 1; | connOptions.nMaxFeeler = 1; | ||||
connOptions.nBestHeight = chainActive.Height(); | connOptions.nBestHeight = chainActive.Height(); | ||||
connOptions.uiInterface = &uiInterface; | connOptions.uiInterface = &uiInterface; | ||||
connOptions.m_msgproc = peerLogic.get(); | connOptions.m_msgproc = peerLogic.get(); | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |