diff options
| author | Peter Todd <[email protected]> | 2013-10-20 22:36:31 -0400 |
|---|---|---|
| committer | langerhans <[email protected]> | 2015-08-28 20:45:39 +0200 |
| commit | acb08f053aa80e96531662d6fcb784285d8b1d19 (patch) | |
| tree | 39f9643b72f69b2d6411c0d0085910ef07b5b9f7 /src/main.cpp | |
| parent | Merge pull request #1247 from rnicoll/1.10-attribution (diff) | |
| download | discoin-acb08f053aa80e96531662d6fcb784285d8b1d19.tar.xz discoin-acb08f053aa80e96531662d6fcb784285d8b1d19.zip | |
Add NODE_BLOOM service bit and bump protocol version
Lets nodes advertise that they offer bloom filter support explicitly.
The protocol version bump allows SPV nodes to assume that NODE_BLOOM is
set if NODE_NETWORK is set for pre-70002 nodes.
Also adds an undocumented option to turn bloom filter support off for
testing purposes. Nodes attempting to use bloom filters are immediately
dropped so as to not waste their bandwidth.
ensure backward compatible service bits
update protocol version to 70004
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5fffaa381..cec2cf18c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4684,6 +4684,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } } + else if (!fBloomFilters && + (strCommand == "filterload" || + strCommand == "filteradd" || + strCommand == "filterclear")) + { + pfrom->CloseSocketDisconnect(); + return error("peer %s attempted to set a bloom filter even though we do not advertise that service", + pfrom->addr.ToString().c_str()); + } else if (strCommand == "filterload") { |