diff options
| author | Matt Corallo <[email protected]> | 2011-06-07 00:48:37 +0200 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2011-06-07 00:54:41 +0200 |
| commit | c6710c7a70658536ab0217dff18a45622ea08680 (patch) | |
| tree | c633a3174f079b7bffbd5a93d9282e417e729399 /src/net.cpp | |
| parent | Reduce minimum TX fee for new transactions, to 0.0005. (diff) | |
| download | discoin-c6710c7a70658536ab0217dff18a45622ea08680.tar.xz discoin-c6710c7a70658536ab0217dff18a45622ea08680.zip | |
Fix CPU Usage bug when using -nolisten and have no connections.
Diffstat (limited to 'src/net.cpp')
| -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); |