aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-03-26 13:31:25 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-13 17:40:16 +0200
commit5e7ab16d29ac66a5a5753dd4f59b6fb12e60654e (patch)
treebffac27c15553b6b5e32086d96bdf7deb701f0c4 /src
parentfc83f181530fb566726e5f3f4197fc5586d77fd8 (diff)
Only store and connect to NODE_NETWORK nodes
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
-rw-r--r--src/net.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7818056d21..bcaf095ab3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4785,6 +4785,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
{
boost::this_thread::interruption_point();
+ if (!(addr.nServices & NODE_NETWORK))
+ continue;
+
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
addr.nTime = nNow - 5 * 24 * 60 * 60;
pfrom->AddAddressKnown(addr);
diff --git a/src/net.cpp b/src/net.cpp
index a0c2bd5091..395e1fe423 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1596,6 +1596,10 @@ void ThreadOpenConnections()
if (IsLimited(addr))
continue;
+ // only connect to full nodes
+ if (!(addr.nServices & NODE_NETWORK))
+ continue;
+
// only consider very recently tried nodes after 30 failed attempts
if (nANow - addr.nLastTry < 600 && nTries < 30)
continue;