mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-12 20:28:27 +00:00
Add amSupernode to make code clearer in the check-if-self-is-supernode case.
This commit is contained in:
@ -415,11 +415,9 @@ Node::ReasonForTermination Node::run()
|
||||
if ((now - lastPingCheck) >= ZT_PING_CHECK_DELAY) {
|
||||
lastPingCheck = now;
|
||||
try {
|
||||
if (_r->topology->isSupernode(_r->identity.address())) {
|
||||
// The only difference in how supernodes behave is here: they only
|
||||
// actively ping each other and only passively listen for pings
|
||||
// from anyone else. They also don't send firewall openers, since
|
||||
// they're never firewalled.
|
||||
if (_r->topology->amSupernode()) {
|
||||
// Supernodes do not ping anyone but each other. They also don't
|
||||
// send firewall openers, since they aren't ever firewalled.
|
||||
std::vector< SharedPtr<Peer> > sns(_r->topology->supernodePeers());
|
||||
for(std::vector< SharedPtr<Peer> >::const_iterator p(sns.begin());p!=sns.end();++p) {
|
||||
if ((now - (*p)->lastDirectSend()) > ZT_PEER_DIRECT_PING_DELAY)
|
||||
|
Reference in New Issue
Block a user