From 58fa6cab4397fe7b0f4fe883e9d1632f5b73f6f9 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 7 Oct 2013 17:00:53 -0400 Subject: Auto-pushing of membership certs on: MULTICAST_FRAME,FRAME,MULTICAST_LIKE and on receipt of MULTICAST_LIKE. --- node/Network.hpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 64e01c57..7d173a21 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -476,7 +476,36 @@ public: * @param force If true, push even if we've already done so within required time frame * @param now Current time */ - void pushMembershipCertificate(const Address &peer,bool force,uint64_t now); + inline void pushMembershipCertificate(const Address &peer,bool force,uint64_t now) + { + Mutex::Lock _l(_lock); + if (!_isOpen) + _pushMembershipCertificate(peer,force,now); + } + + /** + * Push membership certificate to a packed zero-terminated array of addresses + * + * This pushes to all peers in peers[] (length must be a multiple of 5) until + * len is reached or a null address is encountered. + * + * @param peers Packed array of 5-byte big-endian addresses + * @param len Length of peers[] in total, MUST be a multiple of 5 + * @param force If true, push even if we've already done so within required time frame + * @param now Current time + */ + inline void pushMembershipCertificate(const void *peers,unsigned int len,bool force,uint64_t now) + { + Mutex::Lock _l(_lock); + if (!_isOpen) { + for(unsigned int i=0;i &data); + void _pushMembershipCertificate(const Address &peer,bool force,uint64_t now); void _restoreState(); const RuntimeEnvironment *_r; -- cgit v1.2.3