File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1391,6 +1391,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
13911391 // Note that setting NODE_WITNESS is never required: the only downside from not
13921392 // doing so is that after activation, no upgraded nodes will fetch from you.
13931393 nLocalServices |= NODE_WITNESS;
1394+ // Only care about others providing witness capabilities if there is a softfork
1395+ // defined.
1396+ nRelevantServices |= NODE_WITNESS;
13941397 }
13951398
13961399 // ********************************************************* Step 10: import blocks
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ namespace {
7272const static std::string NET_MESSAGE_COMMAND_OTHER = " *other*" ;
7373
7474/* * Services this node implementation cares about */
75- static const uint64_t nRelevantServices = NODE_NETWORK | NODE_WITNESS ;
75+ uint64_t nRelevantServices = NODE_NETWORK;
7676
7777//
7878// Global state variables
@@ -1601,8 +1601,8 @@ void ThreadOpenConnections()
16011601 if (nANow - addr.nLastTry < 600 && nTries < 30 )
16021602 continue ;
16031603
1604- // only consider non-witness nodes after 40 failed attemps
1605- if (! (addr.nServices & NODE_WITNESS) && nTries < 40 )
1604+ // only consider nodes missing relevant services after 40 failed attemps
1605+ if ((addr.nServices & nRelevantServices) != nRelevantServices && nTries < 40 )
16061606 continue ;
16071607
16081608 // do not allow non-default ports, unless after 50 invalid addresses selected already
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer = NULL);
153153extern bool fDiscover ;
154154extern bool fListen ;
155155extern uint64_t nLocalServices;
156+ extern uint64_t nRelevantServices;
156157extern uint64_t nLocalHostNonce;
157158extern CAddrMan addrman;
158159
You can’t perform that action at this time.
0 commit comments