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-170004 nodes.

Also adds an option to turn bloom filter support off for nodes which
advertise a version number >= 170004. Nodes attempting to use bloom
filters on such protocol versions are banned, and a later upgade
should drop nodes of an older version which attempt to use bloom
filters.

Much code stolen from Peter Todd.

Zcash: Implements Zcash equivalent of BIP 111; deploys with Overwinter
This commit is contained in:
Matt Corallo
2015-08-20 21:15:27 -07:00
committed by Jack Grigg
parent f5b1082f9c
commit 8bc4461326
4 changed files with 26 additions and 1 deletions

View File

@@ -1025,6 +1025,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// Option to startup with mocktime set (used for regression testing):
SetMockTime(GetArg("-mocktime", 0)); // SetMockTime(0) is a no-op
if (GetBoolArg("-peerbloomfilters", true))
nLocalServices |= NODE_BLOOM;
#ifdef ENABLE_MINING
if (mapArgs.count("-mineraddress")) {
CBitcoinAddress addr;