Skip to content

Commit ecd7fd3

Browse files
committed
Introduce REQUIRED_SERVICES constant
1 parent ee06e04 commit ecd7fd3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4787,7 +4787,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
47874787
{
47884788
boost::this_thread::interruption_point();
47894789

4790-
if (!(addr.nServices & NODE_NETWORK))
4790+
if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
47914791
continue;
47924792

47934793
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ void ThreadOpenConnections()
15961596
continue;
15971597

15981598
// only connect to full nodes
1599-
if (!(addr.nServices & NODE_NETWORK))
1599+
if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
16001600
continue;
16011601

16021602
// only consider very recently tried nodes after 30 failed attempts

src/net.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ static const bool DEFAULT_FORCEDNSSEED = false;
7272
static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
7373
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
7474

75+
static const ServiceFlags REQUIRED_SERVICES = NODE_NETWORK;
76+
7577
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
7678
static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban
7779

0 commit comments

Comments
 (0)