Clean up some credential push stuff.

This commit is contained in:
Adam Ierymenko 2022-04-19 16:06:53 -04:00
parent 877f86a896
commit cd70fefc5e
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
3 changed files with 5 additions and 12 deletions

View file

@ -64,15 +64,7 @@ public:
*/
void pushCredentials(const RuntimeEnvironment *RR,void *tPtr,const int64_t now,const Address &peerAddress,const NetworkConfig &nconf);
/**
* @param now Current time
* @param lastReceivedCredentials Time we last received updated credentials from the controller
* @return True if we haven't pushed credentials in a long time (to cause proactive credential push)
*/
inline bool shouldPushCredentials(const int64_t now, const int64_t lastReceivedCredentials) const
{
return ((now - _lastPushedCredentials) > ZT_PEER_ACTIVITY_TIMEOUT) || (lastReceivedCredentials > _lastPushedCredentials);
}
inline int64_t lastPushedCredentials() { return _lastPushedCredentials; }
/**
* Check whether we should push MULTICAST_LIKEs to this peer, and update last sent time if true