aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2015-11-26 08:32:38 +0100
committerWladimir J. van der Laan <[email protected]>2015-11-26 08:43:21 +0100
commitbe281d8a83ca8fe7cf785a4608d1a8954b193191 (patch)
tree320d1fc8892f741984c68c3f4adf09454e350d4e /src/main.cpp
parentMerge pull request #7088 (diff)
parentDocument both the peerbloomfilters and enforcenodebloom options. (diff)
downloaddiscoin-be281d8a83ca8fe7cf785a4608d1a8954b193191.tar.xz
discoin-be281d8a83ca8fe7cf785a4608d1a8954b193191.zip
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)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2579b642b..b0b58141a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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,
}
- 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;