aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorJeff Garzik <[email protected]>2014-07-29 11:04:46 -0400
committerRoss Nicoll <[email protected]>2014-08-28 20:39:46 +0100
commit81f8d22c9e834cf854400b039cb8b963e0607729 (patch)
treeb983952ae1132a1feaa04f2d3c90cac073e67daa /src/net.cpp
parentDon't poll showmyip.com, it doesn't exist anymore (diff)
downloaddiscoin-81f8d22c9e834cf854400b039cb8b963e0607729.tar.xz
discoin-81f8d22c9e834cf854400b039cb8b963e0607729.zip
Avoid querying DNS seeds, if we have open connections.
The goal is to increase independence and privacy.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 54b7e6ca4..02e870901 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1166,6 +1166,18 @@ void MapPort(bool)
void ThreadDNSAddressSeed()
{
+ // goal: only query DNS seeds if address need is acute
+ if ((addrman.size() > 0) &&
+ (!GetBoolArg("-forcednsseed", false))) {
+ MilliSleep(11 * 1000);
+
+ LOCK(cs_vNodes);
+ if (vNodes.size() >= 2) {
+ LogPrintf("P2P peers available. Skipped DNS seeding.\n");
+ return;
+ }
+ }
+
const vector<CDNSSeedData> &vSeeds = Params().DNSSeeds();
int found = 0;