mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
Randomize name lookup result in ConnectSocketByName
This commit is contained in:
parent
f9f5cfc506
commit
1a5a4e6488
@ -621,10 +621,10 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
|
|||||||
proxyType nameProxy;
|
proxyType nameProxy;
|
||||||
GetNameProxy(nameProxy);
|
GetNameProxy(nameProxy);
|
||||||
|
|
||||||
CService addrResolved;
|
std::vector<CService> addrResolved;
|
||||||
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy())) {
|
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy(), 256)) {
|
||||||
if (addrResolved.IsValid()) {
|
if (addrResolved.size() > 0) {
|
||||||
addr = addrResolved;
|
addr = addrResolved[GetRand(addrResolved.size())];
|
||||||
return ConnectSocket(addr, hSocketRet, nTimeout);
|
return ConnectSocket(addr, hSocketRet, nTimeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user