From acb08f053aa80e96531662d6fcb784285d8b1d19 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Sun, 20 Oct 2013 22:36:31 -0400 Subject: 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 --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main.cpp') 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") { -- cgit v1.2.3