aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2012-02-01 18:08:03 -0500
committerGregory Maxwell <greg@xiph.org>2012-02-01 18:08:03 -0500
commit5d1b8f1725f5c65a170feb44d182f9016caa9709 (patch)
tree921eb8d680b726cf4e5f87824470a85f2a5cc355 /src/net.cpp
parentd2291cce9235708f3bc3f95ac1b45164a03cd2ce (diff)
downloadbitcoin-5d1b8f1725f5c65a170feb44d182f9016caa9709.tar.xz
Avoid advertising the node's address when it is not listening or IsInitialBlockDownload().
This also avoids flushing setAddrKnown until 24 hours has passed, and avoids contacting the external IP services when not listening. Advertising non-listening nodes is just addr message spam. It doesn't help the network, in fact it hurts the network, and it also hurts user's privacy. Advertising far out of sync nodes doesn't help the network— they can't even forward (most) transactions and wastes nodes outbound slots.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 66c9218cd0..a7eaaaceb6 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -141,7 +141,7 @@ bool GetMyExternalIP(CNetAddr& ipRet)
const char* pszGet;
const char* pszKeyword;
- if (fUseProxy)
+ if (fNoListen||fUseProxy)
return false;
for (int nLookup = 0; nLookup <= 1; nLookup++)