diff options
author | Patick Strateman <patrick.strateman@gmail.com> | 2015-11-24 01:47:32 -0800 |
---|---|---|
committer | Patick Strateman <patrick.strateman@gmail.com> | 2015-11-24 01:50:53 -0800 |
commit | b3caa9b7fa7695e60fc4002229b77f43db8ded67 (patch) | |
tree | efec3088297baf50382a891a91f6a184bc677f39 /src | |
parent | 0b0fc179ab8795463e0a0f07e989ec6f592a1f90 (diff) |
Move bloom filter filtering logic outside of command "switch" (giant if/else).
Moving this logic outside of the "switch" makes it far simpler to
enable the forced disconnect by a parameter.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2579b642b8..fd5637a8cd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3989,6 +3989,21 @@ 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; + } + //TODO: Enable this after reasonable network upgrade + //else { + // pfrom->fDisconnect = true; + // return false; + //} + } if (strCommand == "version") @@ -4750,21 +4765,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; |