diff --git a/node/Cluster.cpp b/node/Cluster.cpp index ec1151593..419948e20 100644 --- a/node/Cluster.cpp +++ b/node/Cluster.cpp @@ -395,6 +395,7 @@ void Cluster::sendViaCluster(const Address &fromPeerAddress,const Address &toPee mostRecentTs = rpe->second; mostRecentMemberId = rpe->first.second; } + ++rpe; } } diff --git a/node/Switch.cpp b/node/Switch.cpp index 7caf8ba60..dcaf7ebd4 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -720,7 +720,8 @@ void Switch::_handleRemotePacketHead(const InetAddress &localAddr,const InetAddr Mutex::Lock _l(_lastUniteAttempt_m); uint64_t &luts = _lastUniteAttempt[_LastUniteKey(source,destination)]; shouldUnite = ((now - luts) >= ZT_MIN_UNITE_INTERVAL); - luts = now; + if (shouldUnite) + luts = now; } RR->cluster->sendViaCluster(source,destination,packet->data(),packet->size(),shouldUnite); return;