From a019c3dd5d141d07a1554e36b6b4c942edfc4d70 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 25 Jun 2019 13:42:20 -0700 Subject: Tighten up credential push just a bit for faster up-time with older nodes, should not have significant impact on bandwidth. Also some cleanup and push direct path timing fixes. --- node/Network.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 9350b3b5..969e1f14 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -368,6 +368,21 @@ public: _membership(to).pushCredentials(RR,tPtr,now,to,_config,-1); } + /** + * Push credentials if we haven't done so in a very long time + * + * @param tPtr Thread pointer to be handed through to any callbacks called as a result of this call + * @param to Destination peer address + * @param now Current time + */ + inline void pushCredentialsIfNeeded(void *tPtr,const Address &to,const int64_t now) + { + Mutex::Lock _l(_lock); + Membership &m = _membership(to); + if (m.shouldPushCredentials(now)) + m.pushCredentials(RR,tPtr,now,to,_config,-1); + } + /** * Destroy this network * -- cgit v1.2.3