Avoid querying DNS seeds, if we have open connections.

The goal is to increase independence and privacy.
This commit is contained in:
Jeff Garzik
2014-07-29 11:04:46 -04:00
parent 2920322871
commit 2e7009d67b
2 changed files with 14 additions and 1 deletions

View File

@@ -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;