diff options
author | Matt Corallo <git@bluematt.me> | 2015-08-20 21:15:27 -0700 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2015-09-05 23:29:13 -0700 |
commit | afb0ccaf9c9e4e8fac7db3564c4e19c9218c6b03 (patch) | |
tree | 14e3b07e6ed8886d97624d73767445b69f6dcb4b /src/init.cpp | |
parent | 536207f3167daad1fa3d60a1de7d9cb55db28ac9 (diff) |
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-70011 nodes.
Also adds an option to turn bloom filter support off for nodes which
advertise a version number >= 70011. 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.
Implements BIP 111
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 5759b4b428..0f409098a7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -918,6 +918,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; + // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // Initialize elliptic curve code |