From d5e0f7e3e453482bf6e7d6d8cb76a68ecc26b287 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 9 Oct 2014 12:42:25 -0700 Subject: Reorg multicast packet, and a whole bunch of refactoring around the pushing of certificates of membership. --- node/Network.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 90ac34d6..a2a49584 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -215,18 +215,19 @@ public: void addMembershipCertificate(const CertificateOfMembership &cert,bool forceAccept); /** - * Push our membership certificate to a peer + * Check if we should push membership certificate to a peer, and update last pushed * - * @param peer Destination peer address - * @param force If true, push even if we've already done so within required time frame + * If we haven't pushed a cert to this peer in a long enough time, this returns + * true and updates the last pushed time. Otherwise it returns false. + * + * This doesn't actually send anything, since COMs can hitch a ride with several + * different kinds of packets. + * + * @param to Destination peer * @param now Current time + * @return True if we should include a COM with whatever we're currently sending */ - inline void pushMembershipCertificate(const Address &peer,bool force,uint64_t now) - { - Mutex::Lock _l(_lock); - if ((_config)&&(!_config->isPublic())&&(_config->com())) - _pushMembershipCertificate(peer,force,now); - } + bool peerNeedsOurMembershipCertificate(const Address &to,uint64_t now); /** * @param peer Peer address to check @@ -445,7 +446,6 @@ public: private: static void _CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned int etherType,const Buffer<4096> &data); - void _pushMembershipCertificate(const Address &peer,bool force,uint64_t now); void _restoreState(); void _dumpMembershipCerts(); -- cgit v1.2.3