@ -1008,11 +1008,17 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
int nInbound = 0 ;
int nMaxInbound = nMaxConnections - m_max_outbound ;
if ( hSocket ! = INVALID_SOCKET ) {
if ( hSocket = = INVALID_SOCKET ) {
const int nErr = WSAGetLastError ( ) ;
if ( nErr ! = WSAEWOULDBLOCK ) {
LogPrintf ( " socket error accept failed: %s \n " , NetworkErrorString ( nErr ) ) ;
}
return ;
}
if ( ! addr . SetSockAddr ( ( const struct sockaddr * ) & sockaddr ) ) {
LogPrintf ( " Warning: Unknown socket family \n " ) ;
}
}
NetPermissionFlags permissionFlags = NetPermissionFlags : : PF_NONE ;
hListenSocket . AddSocketPermissionFlags ( permissionFlags ) ;
@ -1032,14 +1038,6 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
}
}
if ( hSocket = = INVALID_SOCKET )
{
int nErr = WSAGetLastError ( ) ;
if ( nErr ! = WSAEWOULDBLOCK )
LogPrintf ( " socket error accept failed: %s \n " , NetworkErrorString ( nErr ) ) ;
return ;
}
if ( ! fNetworkActive ) {
LogPrint ( BCLog : : NET , " connection from %s dropped: not accepting new connections \n " , addr . ToString ( ) ) ;
CloseSocket ( hSocket ) ;