aboutsummaryrefslogtreecommitdiff
path: root/net.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-01-18 14:46:46 -0500
committerGavin Andresen <[email protected]>2011-01-18 14:46:46 -0500
commitc9f70b381dc8ee4197fd5b3d4d20f302632da0ed (patch)
treec9de69cd651024487fed16ec890e20ef1e721202 /net.cpp
parentEndModal fix for Mac from piotrp (diff)
parentMerge branch 'listaccountsbug' of https://github.com/gavinandresen/bitcoin-gi... (diff)
downloaddiscoin-c9f70b381dc8ee4197fd5b3d4d20f302632da0ed.tar.xz
discoin-c9f70b381dc8ee4197fd5b3d4d20f302632da0ed.zip
Merge branch 'integration' into FIXES
Diffstat (limited to 'net.cpp')
-rw-r--r--net.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/net.cpp b/net.cpp
index da7661962..a626acd37 100644
--- a/net.cpp
+++ b/net.cpp
@@ -643,7 +643,9 @@ void ThreadSocketHandler2(void* parg)
FD_ZERO(&fdsetSend);
FD_ZERO(&fdsetError);
SOCKET hSocketMax = 0;
- FD_SET(hListenSocket, &fdsetRecv);
+
+ if(hListenSocket != INVALID_SOCKET)
+ FD_SET(hListenSocket, &fdsetRecv);
hSocketMax = max(hSocketMax, hListenSocket);
CRITICAL_BLOCK(cs_vNodes)
{
@@ -680,7 +682,7 @@ void ThreadSocketHandler2(void* parg)
//
// Accept new connections
//
- if (FD_ISSET(hListenSocket, &fdsetRecv))
+ if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv))
{
struct sockaddr_in sockaddr;
socklen_t len = sizeof(sockaddr);
@@ -1344,7 +1346,7 @@ void StartNode(void* parg)
#endif
printf("addrLocalHost = %s\n", addrLocalHost.ToString().c_str());
- if (fUseProxy || mapArgs.count("-connect"))
+ if (fUseProxy || mapArgs.count("-connect") || fNoListen)
{
// Proxies can't take incoming connections
addrLocalHost.ip = CAddress("0.0.0.0").ip;