aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-06-13 19:30:04 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-06-13 19:34:17 +0200
commitbe9711e597071c813bdd72c2866c547f117e4865 (patch)
treef965abcecc43584d8f9f9a42629df169fdcc249e /src/net.h
parent44c1b1c9bb54082625c7ad76af25473abf79f866 (diff)
parentecd7fd37c888f8ebc64cf3d92272975b37ae54ca (diff)
downloadbitcoin-be9711e597071c813bdd72c2866c547f117e4865.tar.xz
Merge #7749: Enforce expected outbound services
ecd7fd3 Introduce REQUIRED_SERVICES constant (Pieter Wuille) ee06e04 Introduce enum ServiceFlags for service flags (Pieter Wuille) 15bf863 Don't require services in -addnode (Pieter Wuille) 5e7ab16 Only store and connect to NODE_NETWORK nodes (Pieter Wuille) fc83f18 Verify that outbound connections have expected services (Pieter Wuille) 3764dec Keep addrman's nService bits consistent with outbound observations (Pieter Wuille)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/net.h b/src/net.h
index 5c1f7e3e89..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
@@ -152,7 +154,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL);
extern bool fDiscover;
extern bool fListen;
-extern uint64_t nLocalServices;
+extern ServiceFlags nLocalServices;
extern bool fRelayTxes;
extern uint64_t nLocalHostNonce;
extern CAddrMan addrman;
@@ -186,7 +188,7 @@ class CNodeStats
{
public:
NodeId nodeid;
- uint64_t nServices;
+ ServiceFlags nServices;
bool fRelayTxes;
int64_t nLastSend;
int64_t nLastRecv;
@@ -316,7 +318,8 @@ class CNode
{
public:
// socket
- uint64_t nServices;
+ ServiceFlags nServices;
+ ServiceFlags nServicesExpected;
SOCKET hSocket;
CDataStream ssSend;
size_t nSendSize; // total size of all vSendMsg entries