Permalink
Browse files

Avoid querying DNS seeds, if we have open connections.

Also add a new dns seed.
  • Loading branch information...
Tranz5 committed Aug 26, 2014
1 parent a268230 commit 7f7cc914d365ef0386b073f9ff06bae8eb7162cd
Showing with 14 additions and 3 deletions.
  1. +2 −1 src/init.cpp
  2. +12 −2 src/net.cpp
View
@@ -252,7 +252,8 @@ std::string HelpMessage()
" -irc " + _("Find peers using internet relay chat (default: 1)") + "\n" +
" -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n" +
" -bind=<addr> " + _("Bind to given address. Use [host]:port notation for IPv6") + "\n" +
" -dnsseed " + _("Find peers using DNS lookup (default: 0)") + "\n" +
" -dnsseed " + _("Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)") + "\n" +
" -forcednsseed " + _("Always query for peer addresses via DNS lookup (default: 0)") + "\n" +
" -synctime " + _("Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)") + "\n" +
" -cppolicy " + _("Sync checkpoints policy (default: strict)") + "\n" +
" -banscore=<n> " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n" +
View
@@ -1259,8 +1259,7 @@ static const char *strDNSSeed[][2] = {
{"hoboseed2", "seed2.hobonickels.info"},
{"hoboseed3", "seed3.hobonickels.info"},
{"hoboseed4", "seed4.hobonickels.info"},
{"cce", "hbn.altcointech.net"},
};
void ThreadDNSAddressSeed(void* parg)
@@ -1287,6 +1286,17 @@ void ThreadDNSAddressSeed(void* parg)
void ThreadDNSAddressSeed2(void* parg)
{
printf("ThreadDNSAddressSeed started\n");
// goal: only query DNS seeds if address need is acute
if ((addrman.size() > 0) && (!GetBoolArg("-forcednsseed", false))) {
MilliSleep(25* 1000);
LOCK(cs_vNodes);
if (vNodes.size() >= 2) {
printf("P2P peers available. Skipped DNS seeding.\n");
return;
}
}
int found = 0;
if (!fTestNet)

0 comments on commit 7f7cc91

Please sign in to comment.