Skip to content

Commit

Permalink
Introduce REQUIRED_SERVICES constant
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa authored and Fuzzbawls committed May 11, 2020
1 parent d1391e3 commit a48639f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5396,7 +5396,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
for (CAddress& addr : vAddr) {
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)
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,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
Expand Down
2 changes: 2 additions & 0 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
/** Maximum number of peers added to setOffsetDisconnectedPeers before triggering a warning */
#define MAX_TIMEOFFSET_DISCONNECTIONS 16

static const ServiceFlags REQUIRED_SERVICES = NODE_NETWORK;

unsigned int ReceiveFloodSize();
unsigned int SendBufferSize();

Expand Down

0 comments on commit a48639f

Please sign in to comment.