Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,773 Lines • ▼ Show 20 Lines | if (gArgs.GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS)) { | ||||
nLocalServices = ServiceFlags(nLocalServices | NODE_BLOOM); | nLocalServices = ServiceFlags(nLocalServices | NODE_BLOOM); | ||||
} | } | ||||
// Signal Bitcoin Cash support. | // Signal Bitcoin Cash support. | ||||
// TODO: remove some time after the hardfork when no longer needed | // TODO: remove some time after the hardfork when no longer needed | ||||
// to differentiate the network nodes. | // to differentiate the network nodes. | ||||
nLocalServices = ServiceFlags(nLocalServices | NODE_BITCOIN_CASH); | nLocalServices = ServiceFlags(nLocalServices | NODE_BITCOIN_CASH); | ||||
g_enable_bip61 = gArgs.GetBoolArg("-enablebip61", DEFAULT_ENABLE_BIP61); | |||||
nMaxTipAge = gArgs.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); | nMaxTipAge = gArgs.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); | ||||
return true; | return true; | ||||
} | } | ||||
static bool LockDataDirectory(bool probeOnly) { | static bool LockDataDirectory(bool probeOnly) { | ||||
// Make sure only a single Bitcoin process is using the data directory. | // Make sure only a single Bitcoin process is using the data directory. | ||||
fs::path datadir = GetDataDir(); | fs::path datadir = GetDataDir(); | ||||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | #endif | ||||
// need to reindex later. | // need to reindex later. | ||||
assert(!g_connman); | assert(!g_connman); | ||||
g_connman = std::unique_ptr<CConnman>( | g_connman = std::unique_ptr<CConnman>( | ||||
new CConnman(config, GetRand(std::numeric_limits<uint64_t>::max()), | new CConnman(config, GetRand(std::numeric_limits<uint64_t>::max()), | ||||
GetRand(std::numeric_limits<uint64_t>::max()))); | GetRand(std::numeric_limits<uint64_t>::max()))); | ||||
CConnman &connman = *g_connman; | CConnman &connman = *g_connman; | ||||
peerLogic.reset(new PeerLogicValidation(&connman, scheduler)); | peerLogic.reset(new PeerLogicValidation( | ||||
&connman, scheduler, | |||||
gArgs.GetBoolArg("-enablebip61", DEFAULT_ENABLE_BIP61))); | |||||
RegisterValidationInterface(peerLogic.get()); | RegisterValidationInterface(peerLogic.get()); | ||||
// sanitize comments per BIP-0014, format user agent and check total size | // sanitize comments per BIP-0014, format user agent and check total size | ||||
std::vector<std::string> uacomments; | std::vector<std::string> uacomments; | ||||
for (const std::string &cmt : gArgs.GetArgs("-uacomment")) { | for (const std::string &cmt : gArgs.GetArgs("-uacomment")) { | ||||
if (cmt != SanitizeString(cmt, SAFE_CHARS_UA_COMMENT)) | if (cmt != SanitizeString(cmt, SAFE_CHARS_UA_COMMENT)) | ||||
return InitError(strprintf( | return InitError(strprintf( | ||||
_("User Agent comment (%s) contains unsafe characters."), cmt)); | _("User Agent comment (%s) contains unsafe characters."), cmt)); | ||||
▲ Show 20 Lines • Show All 539 Lines • Show Last 20 Lines |