aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-03-12 11:13:57 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-12 11:14:03 +0100
commitdd4ffcec0ea561e16c4621b31712166717db3e0b (patch)
tree287c1b988fa2d912ff4f830317d77482b554f0b7 /src/net.h
parent164d7b674b49b3c062d0331f28d21ad4f6bf5207 (diff)
parent9519a9a4202cd5fcaaad6d4cf0bf6bad38a27369 (diff)
Merge pull request #5859
9519a9a Add correct bool combiner for net signals (Pieter Wuille)
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 7dd02b84ef..9fc6ce68d0 100644
--- a/src/net.h
+++ b/src/net.h
@@ -78,12 +78,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;
};