changeset 23689:3241c82e16eb

Fix Windows Compile Error for Boost Interruption point
author Peter Tschipper <peter.tschipper@gmailcom>
date Tue, 16 Feb 2016 14:29:56 -0800
parents 66370fb8e249
children 8be78259f37f
files src/unlimited.cpp
diffstat 1 files changed, 24 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/unlimited.cpp	Tue Feb 16 11:00:41 2016 -0800
+++ b/src/unlimited.cpp	Tue Feb 16 14:29:56 2016 -0800
@@ -24,6 +24,7 @@
 
 #include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
+#include <boost/thread.hpp>
 #include <inttypes.h>
 
 using namespace std;
@@ -665,35 +666,33 @@
 
 bool ThinBlockMessageHandler(vector<CNode*>& vNodesCopy)
 {
-  bool sleep = true;
-  CNodeSignals& signals = GetNodeSignals();
-  BOOST_FOREACH (CNode* pnode, vNodesCopy)
+    bool sleep = true;
+    CNodeSignals& signals = GetNodeSignals();
+    BOOST_FOREACH (CNode* pnode, vNodesCopy)
     {
-      if ((pnode->fDisconnect)||(!pnode->ThinBlockCapable()))
-        continue;
+        if ((pnode->fDisconnect) || (!pnode->ThinBlockCapable()))
+            continue;
 
-      // Receive messages
-      {
-        TRY_LOCK(pnode->cs_vRecvMsg, lockRecv);
-        if (lockRecv)
-          {
-            if (!signals.ProcessMessages(pnode))
-              pnode->CloseSocketDisconnect();
+        // Receive messages
+        {
+            TRY_LOCK(pnode->cs_vRecvMsg, lockRecv);
+            if (lockRecv)
+            {
+                if (!signals.ProcessMessages(pnode))
+                    pnode->CloseSocketDisconnect();
 
-            if (pnode->nSendSize < SendBufferSize())
-              {
-                if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg[0].complete()))
-                  {
-                    sleep = false;
-                  }
-              }
-          }
-      }
-      boost::this_thread::interruption_point();
-      signals.SendMessages(pnode);
-      boost::this_thread::interruption_point();
+                if (pnode->nSendSize < SendBufferSize())
+                {
+                    if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg[0].complete()))
+                        sleep = false;
+                }
+            }
+        }
+        boost::this_thread::interruption_point();
+        signals.SendMessages(pnode);
+        boost::this_thread::interruption_point();
     }
-  return sleep;
+    return sleep;
 }
 
 void ConnectToThinBlockNodes()