Randomize name lookup result in ConnectSocketByName
This commit is contained in:
parent
f9f5cfc506
commit
1a5a4e6488
1 changed files with 4 additions and 4 deletions
|
@ -621,10 +621,10 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
|
|||
proxyType nameProxy;
|
||||
GetNameProxy(nameProxy);
|
||||
|
||||
CService addrResolved;
|
||||
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy())) {
|
||||
if (addrResolved.IsValid()) {
|
||||
addr = addrResolved;
|
||||
std::vector<CService> addrResolved;
|
||||
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy(), 256)) {
|
||||
if (addrResolved.size() > 0) {
|
||||
addr = addrResolved[GetRand(addrResolved.size())];
|
||||
return ConnectSocket(addr, hSocketRet, nTimeout);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue