|
|
@ -1391,7 +1391,7 @@ void ThreadOpenConnections2(void* parg)
|
|
|
|
printf("ThreadOpenConnections started\n");
|
|
|
|
printf("ThreadOpenConnections started\n");
|
|
|
|
|
|
|
|
|
|
|
|
// Connect to specific addresses
|
|
|
|
// Connect to specific addresses
|
|
|
|
if (mapArgs.count("-connect"))
|
|
|
|
if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (int64 nLoop = 0;; nLoop++)
|
|
|
|
for (int64 nLoop = 0;; nLoop++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1407,6 +1407,7 @@ void ThreadOpenConnections2(void* parg)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Sleep(500);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1480,7 +1481,12 @@ void ThreadOpenConnections2(void* parg)
|
|
|
|
if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr))
|
|
|
|
if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr))
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If we didn't find an appropriate destination after trying 100 addresses fetched from addrman,
|
|
|
|
|
|
|
|
// stop this loop, and let the outer loop run again (which sleeps, adds seed nodes, recalculates
|
|
|
|
|
|
|
|
// already-connected network ranges, ...) before trying new addrman addresses.
|
|
|
|
nTries++;
|
|
|
|
nTries++;
|
|
|
|
|
|
|
|
if (nTries > 100)
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
if (IsLimited(addr))
|
|
|
|
if (IsLimited(addr))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|