Skip to content

Commit 5e7ab16

Browse files
committed
Only store and connect to NODE_NETWORK nodes
1 parent fc83f18 commit 5e7ab16

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4785,6 +4785,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
47854785
{
47864786
boost::this_thread::interruption_point();
47874787

4788+
if (!(addr.nServices & NODE_NETWORK))
4789+
continue;
4790+
47884791
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
47894792
addr.nTime = nNow - 5 * 24 * 60 * 60;
47904793
pfrom->AddAddressKnown(addr);

src/net.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,10 @@ void ThreadOpenConnections()
15961596
if (IsLimited(addr))
15971597
continue;
15981598

1599+
// only connect to full nodes
1600+
if (!(addr.nServices & NODE_NETWORK))
1601+
continue;
1602+
15991603
// only consider very recently tried nodes after 30 failed attempts
16001604
if (nANow - addr.nLastTry < 600 && nTries < 30)
16011605
continue;

0 commit comments

Comments
 (0)