aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-06-13 16:01:21 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-13 17:40:16 +0200
commitecd7fd37c888f8ebc64cf3d92272975b37ae54ca (patch)
treef965abcecc43584d8f9f9a42629df169fdcc249e
parentee06e04369c37da21e048fda849cce2a1f066f84 (diff)
downloadbitcoin-ecd7fd37c888f8ebc64cf3d92272975b37ae54ca.tar.xz
Introduce REQUIRED_SERVICES constant
-rw-r--r--src/main.cpp2
-rw-r--r--src/net.cpp2
-rw-r--r--src/net.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c1569545b4..62012bf567 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4787,7 +4787,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
{
boost::this_thread::interruption_point();
- if (!(addr.nServices & NODE_NETWORK))
+ if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
continue;
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
diff --git a/src/net.cpp b/src/net.cpp
index 4661974d21..a390eca776 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1596,7 +1596,7 @@ void ThreadOpenConnections()
continue;
// only connect to full nodes
- if (!(addr.nServices & NODE_NETWORK))
+ if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
continue;
// only consider very recently tried nodes after 30 failed attempts
diff --git a/src/net.h b/src/net.h
index f5fb8faae2..2aaca4888f 100644
--- a/src/net.h
+++ b/src/net.h
@@ -72,6 +72,8 @@ static const bool DEFAULT_FORCEDNSSEED = false;
static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
+static const ServiceFlags REQUIRED_SERVICES = NODE_NETWORK;
+
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban