diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-12-04 12:45:21 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-12-04 12:45:21 -0800 |
| commit | ac8918992b647c80c6da4b7c0956fd383b15e9d7 (patch) | |
| tree | 67dbe17f61a99c89cf8e5ba8b5df435b007b288e /node/Switch.cpp | |
| parent | cbf8d9c45b1e09d55f426a2c1cbaa7b9e1830950 (diff) | |
| parent | a4cfe4cd1650ea7e9aada0b004fd7aade2e43ced (diff) | |
| download | infinitytier-ac8918992b647c80c6da4b7c0956fd383b15e9d7.tar.gz infinitytier-ac8918992b647c80c6da4b7c0956fd383b15e9d7.zip | |
Merge dev.
Diffstat (limited to 'node/Switch.cpp')
| -rw-r--r-- | node/Switch.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index 74e2f4c6..bf0d1aff 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -820,10 +820,12 @@ bool Switch::_trySend(const Packet &packet,bool encrypt,uint64_t nwid) for(std::vector< std::pair<Address,InetAddress> >::const_iterator r(nconf->relays().begin());r!=nconf->relays().end();++r) { if (r->first != peer->address()) { SharedPtr<Peer> rp(RR->topology->getPeer(r->first)); - const unsigned int q = rp->relayQuality(now); - if ((rp)&&(q < bestq)) { // SUBTILE: < == don't use these if they are nil quality (unsigned int max), instead use a root - bestq = q; - rp.swap(relay); + if (rp) { + const unsigned int q = rp->relayQuality(now); + if (q < bestq) { // SUBTILE: < == don't use these if they are nil quality (unsigned int max), instead use a root + bestq = q; + rp.swap(relay); + } } } } |
