Do not signal outbound semaphore if uninitialized
authorPieter Wuille <pieter.wuille@gmail.com>
Sat, 12 May 2012 15:44:14 +0000 (17:44 +0200)
committerLuke Dashjr <luke-jr+git@utopios.org>
Fri, 25 May 2012 21:32:06 +0000 (21:32 +0000)
src/net.cpp

index 1227412..37b01f7 100644 (file)
@@ -1703,8 +1703,9 @@ bool StopNode()
     fShutdown = true;
     nTransactionsUpdated++;
     int64 nStart = GetTime();
-    for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++)
-         semOutbound->post();
+    if (semOutbound)
+        for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++)
+            semOutbound->post();
     do
     {
         int nThreadsRunning = 0;