aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-07-29 11:04:46 -0400
committerJeff Garzik <jgarzik@bitpay.com>2014-07-29 11:04:46 -0400
commit2e7009d67b862cf822a1c70e181de6af659a3096 (patch)
tree602ae29c65803e3658664e43bcefd41b118fa14d /src/net.cpp
parent29203228710de3e180914c1d66f48dd7e41270a0 (diff)
downloadbitcoin-2e7009d67b862cf822a1c70e181de6af659a3096.tar.xz
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 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<CDNSSeedData> &vSeeds = Params().DNSSeeds();
int found = 0;