diff options
| author | Jeff Garzik <[email protected]> | 2011-06-09 22:42:25 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2011-06-09 22:42:25 -0700 |
| commit | 65ee333ae0f5ee3cbaf0bc0e60112bae4ea538c0 (patch) | |
| tree | 4d106b4794f8a97003f44e8608c1fc43c4b0b671 /src | |
| parent | Merge pull request #310 from xslidian/master (diff) | |
| parent | Fix CPU Usage bug when using -nolisten and have no connections. (diff) | |
| download | discoin-65ee333ae0f5ee3cbaf0bc0e60112bae4ea538c0.tar.xz discoin-65ee333ae0f5ee3cbaf0bc0e60112bae4ea538c0.zip | |
Merge pull request #304 from TheBlueMatt/cpufix
Fix CPU Usage bug when using -nolisten and have no connections.
Diffstat (limited to 'src')
| -rw-r--r-- | src/net.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 39360a334..c884e8d5e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -756,9 +756,12 @@ void ThreadSocketHandler2(void* parg) if (nSelect == SOCKET_ERROR) { int nErr = WSAGetLastError(); - printf("socket select error %d\n", nErr); - for (int i = 0; i <= hSocketMax; i++) - FD_SET(i, &fdsetRecv); + if (hSocketMax > -1) + { + printf("socket select error %d\n", nErr); + for (int i = 0; i <= hSocketMax; i++) + FD_SET(i, &fdsetRecv); + } FD_ZERO(&fdsetSend); FD_ZERO(&fdsetError); Sleep(timeout.tv_usec/1000); |