Skip to content

Commit be281d8

Browse files
committed
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)
2 parents 2b2ddc5 + 9cf6688 commit be281d8

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/init.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ std::string HelpMessage(HelpMessageMode mode)
362362
strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy"));
363363
strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
364364
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1));
365+
strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with bloom filters (default: %u)"), 1));
366+
if (showDebug)
367+
strUsage += HelpMessageOpt("-enforcenodebloom", strprintf("Enforce minimum protocol version to limit use of bloom filters (default: %u)", 0));
365368
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 8333, 18333));
366369
strUsage += HelpMessageOpt("-proxy=<ip:port>", _("Connect through SOCKS5 proxy"));
367370
strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), 1));

src/main.cpp

+13-15
Original file line numberDiff line numberDiff line change
@@ -3989,6 +3989,19 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
39893989
}
39903990

39913991

3992+
if (!(nLocalServices & NODE_BLOOM) &&
3993+
(strCommand == "filterload" ||
3994+
strCommand == "filteradd" ||
3995+
strCommand == "filterclear"))
3996+
{
3997+
if (pfrom->nVersion >= NO_BLOOM_VERSION) {
3998+
Misbehaving(pfrom->GetId(), 100);
3999+
return false;
4000+
} else if (GetBoolArg("-enforcenodebloom", false)) {
4001+
pfrom->fDisconnect = true;
4002+
return false;
4003+
}
4004+
}
39924005

39934006

39944007
if (strCommand == "version")
@@ -4750,21 +4763,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
47504763
}
47514764

47524765

4753-
else if (!(nLocalServices & NODE_BLOOM) &&
4754-
(strCommand == "filterload" ||
4755-
strCommand == "filteradd" ||
4756-
strCommand == "filterclear") &&
4757-
//TODO: Remove this line after reasonable network upgrade
4758-
pfrom->nVersion >= NO_BLOOM_VERSION)
4759-
{
4760-
if (pfrom->nVersion >= NO_BLOOM_VERSION)
4761-
Misbehaving(pfrom->GetId(), 100);
4762-
//TODO: Enable this after reasonable network upgrade
4763-
//else
4764-
// pfrom->fDisconnect = true;
4765-
}
4766-
4767-
47684766
else if (strCommand == "filterload")
47694767
{
47704768
CBloomFilter filter;

0 commit comments

Comments
 (0)