diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-05-25 15:25:40 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2023-08-24 14:40:03 +0200 |
commit | 944b21b70ae490a5a746bcc1810a5074d74e9d34 (patch) | |
tree | bffc6929f20b78e6dfadd79cc8a5fc0961d2dd3a /src/netbase.cpp | |
parent | aeac68d036e3cff57ce155f1a904d77f98b357d4 (diff) | |
download | bitcoin-944b21b70ae490a5a746bcc1810a5074d74e9d34.tar.xz |
net: don't check if the socket is valid in ConnectSocketDirectly()
The socket is always valid (the underlying file descriptor is not
`INVALID_SOCKET`) when `ConnectSocketDirectly()` is called.
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index a8419217f4..ca1a80d72f 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -514,10 +514,6 @@ bool ConnectSocketDirectly(const CService &addrConnect, const Sock& sock, int nT // Create a sockaddr from the specified service. struct sockaddr_storage sockaddr; socklen_t len = sizeof(sockaddr); - if (sock.Get() == INVALID_SOCKET) { - LogPrintf("Cannot connect to %s: invalid socket\n", addrConnect.ToStringAddrPort()); - return false; - } if (!addrConnect.GetSockAddr((struct sockaddr*)&sockaddr, &len)) { LogPrintf("Cannot connect to %s: unsupported network\n", addrConnect.ToStringAddrPort()); return false; |