diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-02 14:40:26 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-02 14:40:26 -0700 |
commit | 91940cbcf52c6b09f343e365632b8a1701732099 (patch) | |
tree | 7312b67871a97d8a1edf97501f3621606bb7ec84 /node/Switch.cpp | |
parent | 77bd8aacd1bb17cd9c2213ffb4dd455330e587e0 (diff) | |
download | infinitytier-91940cbcf52c6b09f343e365632b8a1701732099.tar.gz infinitytier-91940cbcf52c6b09f343e365632b8a1701732099.zip |
Kill network preferred relays -- this feature is gone (and was seldom used anyway) in favor of federation.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r-- | node/Switch.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index f644774f..41756aa9 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -844,33 +844,11 @@ bool Switch::_trySend(const Packet &packet,bool encrypt,uint64_t nwid) SharedPtr<Peer> relay; if (!viaPath) { - if (network) { - unsigned int bestq = ~((unsigned int)0); // max unsigned int since quality is lower==better - unsigned int ptr = 0; - for(;;) { - const Address raddr(network->config().nextRelay(ptr)); - if (raddr) { - SharedPtr<Peer> rp(RR->topology->getPeer(raddr)); - if (rp) { - const unsigned int q = rp->relayQuality(now); - if (q < bestq) { - bestq = q; - rp.swap(relay); - } - } - } else break; - } - } - - if (!relay) - relay = RR->topology->getBestRoot(); - + relay = RR->topology->getBestRoot(); if ( (!relay) || (!(viaPath = relay->getBestPath(now))) ) return false; } - // viaPath will not be null if we make it here - // Push possible direct paths to us if we are relaying if (relay) { peer->pushDirectPaths(viaPath->localAddress(),viaPath->address(),now,false,( (network)&&(network->isAllowed(peer)) )); viaPath->sent(now); |