Set _WIN32_WINNT to windows 7
[novacoin.git] / src / net.cpp
index a47f2fd..64695a0 100644 (file)
@@ -8,7 +8,7 @@
 #include "net.h"
 #include "init.h"
 #include "addrman.h"
-#include "ui_interface.h"
+#include "interface.h"
 #include "miner.h"
 #include "ntp.h"
 
@@ -1531,8 +1531,13 @@ void ThreadMessageHandler2(void* parg)
             // Receive messages
             {
                 TRY_LOCK(pnode->cs_vRecv, lockRecv);
-                if (lockRecv)
-                    ProcessMessages(pnode);
+                if (lockRecv) {
+                    if (!ProcessMessages(pnode)) {
+                        pnode->CloseSocketDisconnect();
+                        if (pnode == pnodeSync)
+                            fHaveSyncNode = false;
+                    }
+                }
             }
             if (fShutdown)
                 return;