From 91940cbcf52c6b09f343e365632b8a1701732099 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 2 Aug 2016 14:40:26 -0700 Subject: Kill network preferred relays -- this feature is gone (and was seldom used anyway) in favor of federation. --- node/Switch.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'node/Switch.cpp') 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 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 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); -- cgit v1.2.3