From 25b12b8839be4fc5a051656aad82870c083cce4d Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Sun, 13 Dec 2009 00:13:16 +0000 Subject: misc exit code, updated setup.nsi --- net.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'net.cpp') diff --git a/net.cpp b/net.cpp index 436a5abf7b..941e7c4dc9 100644 --- a/net.cpp +++ b/net.cpp @@ -929,7 +929,7 @@ void ThreadOpenConnections2(void* parg) // Only try the old stuff if we don't have enough connections if (vNodes.size() >= 2 && nSinceLastSeen > 7 * 24 * 60 * 60) continue; - if (vNodes.size() >= 4 && nSinceLastSeen > 24 * 60 * 60) + if (vNodes.size() >= 5 && nSinceLastSeen > 24 * 60 * 60) continue; // If multiple addresses are ready, prioritize by time since @@ -1256,11 +1256,14 @@ void StartNode(void* parg) // // Thread monitoring + // Not really needed anymore, the cause of the hanging was fixed // loop { - Sleep(15000); - if (GetTime() - nThreadSocketHandlerHeartbeat > 4 * 60) + Sleep(1000); + if (fShutdown) + return; + if (GetTime() - nThreadSocketHandlerHeartbeat > 15 * 60) { // First see if closing sockets will free it printf("*** ThreadSocketHandler is stopped ***\n"); @@ -1280,6 +1283,8 @@ void StartNode(void* parg) } } Sleep(10000); + if (fShutdown) + return; if (GetTime() - nThreadSocketHandlerHeartbeat < 60) continue; -- cgit v1.2.3