Browse Source

Merge pull request #7087

9cf6688 Document both the peerbloomfilters and enforcenodebloom options. (Patick Strateman)
0f4dc53 Add enforcenodebloom option. (Patick Strateman)
b3caa9b Move bloom filter filtering logic outside of command "switch" (giant if/else). (Patick Strateman)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
be281d8a83
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 3
      src/init.cpp
  2. 28
      src/main.cpp

3
src/init.cpp

@ -362,6 +362,9 @@ std::string HelpMessage(HelpMessageMode mode) @@ -362,6 +362,9 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy"));
strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
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));
if (showDebug)
strUsage += HelpMessageOpt("-enforcenodebloom", strprintf("Enforce minimum protocol version to limit use of bloom filters (default: %u)", 0));
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 8333, 18333));
strUsage += HelpMessageOpt("-proxy=<ip:port>", _("Connect through SOCKS5 proxy"));
strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), 1));

28
src/main.cpp

@ -3989,6 +3989,19 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, @@ -3989,6 +3989,19 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}
if (!(nLocalServices & NODE_BLOOM) &&
(strCommand == "filterload" ||
strCommand == "filteradd" ||
strCommand == "filterclear"))
{
if (pfrom->nVersion >= NO_BLOOM_VERSION) {
Misbehaving(pfrom->GetId(), 100);
return false;
} else if (GetBoolArg("-enforcenodebloom", false)) {
pfrom->fDisconnect = true;
return false;
}
}
if (strCommand == "version")
@ -4750,21 +4763,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, @@ -4750,21 +4763,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}
else if (!(nLocalServices & NODE_BLOOM) &&
(strCommand == "filterload" ||
strCommand == "filteradd" ||
strCommand == "filterclear") &&
//TODO: Remove this line after reasonable network upgrade
pfrom->nVersion >= NO_BLOOM_VERSION)
{
if (pfrom->nVersion >= NO_BLOOM_VERSION)
Misbehaving(pfrom->GetId(), 100);
//TODO: Enable this after reasonable network upgrade
//else
// pfrom->fDisconnect = true;
}
else if (strCommand == "filterload")
{
CBloomFilter filter;

Loading…
Cancel
Save