summaryrefslogtreecommitdiff
path: root/node/Network.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-24 16:57:26 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-24 16:57:26 -0400
commit5901972958d6ef50671b7bbb89d2b365e4baf17c (patch)
treea614ed5c2d685131ea45e57a89c0cd08dbe0db2e /node/Network.cpp
parentbbcd76ecd0c66adf73d32e2a7ab152a85af9879c (diff)
downloadinfinitytier-5901972958d6ef50671b7bbb89d2b365e4baf17c.tar.gz
infinitytier-5901972958d6ef50671b7bbb89d2b365e4baf17c.zip
More tying up of certificate of membership stuff in the client.
Diffstat (limited to 'node/Network.cpp')
-rw-r--r--node/Network.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/node/Network.cpp b/node/Network.cpp
index acc2588d..43cd83a2 100644
--- a/node/Network.cpp
+++ b/node/Network.cpp
@@ -221,12 +221,14 @@ void Network::_CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned
void Network::_pushMembershipCertificate(const Address &peer,bool force,uint64_t now)
{
- uint64_t timestampMaxDelta = _config->com().timestampMaxDelta();
- if (!timestampMaxDelta)
+ uint64_t pushTimeout = _config->com().timestampMaxDelta() / 2;
+ if (!pushTimeout)
return; // still waiting on my own cert
+ if (pushTimeout > 1000)
+ pushTimeout -= 1000;
uint64_t &lastPushed = _lastPushedMembershipCertificate[peer];
- if ((force)||((now - lastPushed) > (timestampMaxDelta / 2))) {
+ if ((force)||((now - lastPushed) > pushTimeout)) {
lastPushed = now;
Packet outp(peer,_r->identity.address(),Packet::VERB_NETWORK_MEMBERSHIP_CERTIFICATE);