From 2e7009d67b862cf822a1c70e181de6af659a3096 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 29 Jul 2014 11:04:46 -0400 Subject: Avoid querying DNS seeds, if we have open connections. The goal is to increase independence and privacy. --- src/net.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index e004fbeb73..62124514c8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1221,6 +1221,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 &vSeeds = Params().DNSSeeds(); int found = 0; -- cgit v1.2.3