Merge pull request 'clearnet=0' (#457) from clearnet into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/457
This commit is contained in:
12
src/init.cpp
12
src/init.cpp
@@ -432,6 +432,8 @@ std::string HelpMessage(HelpMessageMode mode)
|
|||||||
strUsage += HelpMessageOpt("-disableipv4", _("Disable Ipv4 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV4));
|
strUsage += HelpMessageOpt("-disableipv4", _("Disable Ipv4 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV4));
|
||||||
strUsage += HelpMessageOpt("-disableipv6", _("Disable Ipv6 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV6));
|
strUsage += HelpMessageOpt("-disableipv6", _("Disable Ipv6 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV6));
|
||||||
|
|
||||||
|
strUsage += HelpMessageOpt("-clearnet", _("Enable clearnet connections. Setting to 0 will disable clearnet and use sane defaults for Tor/i2p") + " " + strprintf(_("(default: %u)"), DEFAULT_CLEARNET));
|
||||||
|
|
||||||
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1));
|
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1));
|
||||||
strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with Bloom filters (default: %u)"), 1));
|
strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with Bloom filters (default: %u)"), 1));
|
||||||
if (showDebug)
|
if (showDebug)
|
||||||
@@ -1643,6 +1645,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
//fprintf(stderr,"%s tik18\n", __FUNCTION__);
|
//fprintf(stderr,"%s tik18\n", __FUNCTION__);
|
||||||
|
|
||||||
|
// Disable clearnet peers if -clearnet=0
|
||||||
|
if (!GetBoolArg("-clearnet", DEFAULT_CLEARNET)) {
|
||||||
|
SoftSetBoolArg("-disableipv4", true);
|
||||||
|
SoftSetBoolArg("-disableipv6", true);
|
||||||
|
SoftSetArg("-onlynet", "onion");
|
||||||
|
SoftSetArg("-onlynet", "i2p");
|
||||||
|
SoftSetArg("-onion", "127.0.0.1:9050");
|
||||||
|
SoftSetArg("-i2psam", "127.0.0.1:7656");
|
||||||
|
}
|
||||||
|
|
||||||
if (mapArgs.count("-onlynet")) {
|
if (mapArgs.count("-onlynet")) {
|
||||||
std::set<enum Network> nets;
|
std::set<enum Network> nets;
|
||||||
BOOST_FOREACH(const std::string& snet, mapMultiArgs["-onlynet"]) {
|
BOOST_FOREACH(const std::string& snet, mapMultiArgs["-onlynet"]) {
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ static const unsigned int MAX_SUBVERSION_LENGTH = 256;
|
|||||||
/** -listen default */
|
/** -listen default */
|
||||||
static const bool DEFAULT_LISTEN = true;
|
static const bool DEFAULT_LISTEN = true;
|
||||||
|
|
||||||
|
/** -clearnet default */
|
||||||
|
static const bool DEFAULT_CLEARNET = true;
|
||||||
|
|
||||||
/** -disableipv4 default */
|
/** -disableipv4 default */
|
||||||
static const bool DEFAULT_DISABLE_IPV4 = false;
|
static const bool DEFAULT_DISABLE_IPV4 = false;
|
||||||
/** -disableipv6 default */
|
/** -disableipv6 default */
|
||||||
|
|||||||
Reference in New Issue
Block a user