aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-03-05 04:01:01 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2015-03-06 03:45:26 -0800
commit9519a9a4202cd5fcaaad6d4cf0bf6bad38a27369 (patch)
treed89c628e0de68971753dbaa9d67b707ba3ebc1ad /src/net.h
parent84a05b843b8ab704266289de67c9779ad733a196 (diff)
Add correct bool combiner for net signals
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index d2b2d88ddb..e500536cb4 100644
--- a/src/net.h
+++ b/src/net.h
@@ -76,12 +76,27 @@ void SocketSendData(CNode *pnode);
typedef int NodeId;
+struct CombinerAll
+{
+ typedef bool result_type;
+
+ template<typename I>
+ bool operator()(I first, I last) const
+ {
+ while (first != last) {
+ if (!(*first)) return false;
+ ++first;
+ }
+ return true;
+ }
+};
+
// Signals for message handling
struct CNodeSignals
{
boost::signals2::signal<int ()> GetHeight;
- boost::signals2::signal<bool (CNode*)> ProcessMessages;
- boost::signals2::signal<bool (CNode*, bool)> SendMessages;
+ boost::signals2::signal<bool (CNode*), CombinerAll> ProcessMessages;
+ boost::signals2::signal<bool (CNode*, bool), CombinerAll> SendMessages;
boost::signals2::signal<void (NodeId, const CNode*)> InitializeNode;
boost::signals2::signal<void (NodeId)> FinalizeNode;
};