From 5341e32729e21b1880afe121e5c36bfa9cfefd00 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 1 Jun 2015 19:05:27 -0700 Subject: Fix to GitHub issue #140 -- network preferred relays. Also go ahead and allow RENDEZVOUS from regular peers. --- node/Switch.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'node/Switch.cpp') diff --git a/node/Switch.cpp b/node/Switch.cpp index d01d77ca..0aa0b664 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -741,9 +741,11 @@ bool Switch::_trySend(const Packet &packet,bool encrypt,uint64_t nwid) if (nconf) { unsigned int latency = ~((unsigned int)0); for(std::vector< std::pair >::const_iterator r(nconf->relays().begin());r!=nconf->relays().end();++r) { - SharedPtr rp(RR->topology->getPeer(r->first)); - if ((rp->hasActiveDirectPath(now))&&(rp->latency() <= latency)) - rp.swap(relay); + if (r->first != peer->address()) { + SharedPtr rp(RR->topology->getPeer(r->first)); + if ((rp)&&(rp->hasActiveDirectPath(now))&&(rp->latency() <= latency)) + rp.swap(relay); + } } } } -- cgit v1.2.3