X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fnetbase.cpp;h=00e4bfdee1d6d35f61a293d613152a45050e4698;hb=bd623937c9ad9b227aff096ebc4d39c3b8a7d7d7;hp=1e7172e01b29097155e80836d1c503b3cd9ec68e;hpb=47bb141bf2d589db630ac1a917189b05b75b80d0;p=novacoin.git diff --git a/src/netbase.cpp b/src/netbase.cpp index 1e7172e..00e4bfd 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -359,8 +359,9 @@ bool static ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRe if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR) { + int nErr = WSAGetLastError(); // WSAEINVAL is here because some legacy version of winsock uses it - if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK || WSAGetLastError() == WSAEINVAL) + if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) { struct timeval timeout; timeout.tv_sec = nTimeout / 1000;