File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,8 @@ std::string HelpMessage(HelpMessageMode mode)
240
240
strUsage += " -connect=<ip> " + _ (" Connect only to the specified node(s)" ) + " \n " ;
241
241
strUsage += " -discover " + _ (" Discover own IP address (default: 1 when listening and no -externalip)" ) + " \n " ;
242
242
strUsage += " -dns " + _ (" Allow DNS lookups for -addnode, -seednode and -connect" ) + " " + _ (" (default: 1)" ) + " \n " ;
243
- strUsage += " -dnsseed " + _ (" Find peers using DNS lookup (default: 1 unless -connect)" ) + " \n " ;
243
+ strUsage += " -dnsseed " + _ (" Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)" ) + " \n " ;
244
+ strUsage += " -forcednsseed " + _ (" Always query for peer addresses via DNS lookup (default: 0)" ) + " \n " ;
244
245
strUsage += " -externalip=<ip> " + _ (" Specify your own public address" ) + " \n " ;
245
246
strUsage += " -listen " + _ (" Accept connections from outside (default: 1 if no -proxy or -connect)" ) + " \n " ;
246
247
strUsage += " -maxconnections=<n> " + _ (" Maintain at most <n> connections to peers (default: 125)" ) + " \n " ;
Original file line number Diff line number Diff line change @@ -1221,6 +1221,18 @@ void MapPort(bool)
1221
1221
1222
1222
void ThreadDNSAddressSeed ()
1223
1223
{
1224
+ // goal: only query DNS seeds if address need is acute
1225
+ if ((addrman.size () > 0 ) &&
1226
+ (!GetBoolArg (" -forcednsseed" , false ))) {
1227
+ MilliSleep (11 * 1000 );
1228
+
1229
+ LOCK (cs_vNodes);
1230
+ if (vNodes.size () >= 2 ) {
1231
+ LogPrintf (" P2P peers available. Skipped DNS seeding.\n " );
1232
+ return ;
1233
+ }
1234
+ }
1235
+
1224
1236
const vector<CDNSSeedData> &vSeeds = Params ().DNSSeeds ();
1225
1237
int found = 0 ;
1226
1238
You can’t perform that action at this time.
0 commit comments