diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-28 12:18:59 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-28 12:18:59 -0700 |
commit | 21e6850722539d4ff72b6c5841da47356233bb67 (patch) | |
tree | 2864190eb2c6af588fcd54e2771f8ad0ccb5d4c0 /node/Switch.cpp | |
parent | 5986d837384d5794286ee6954bc433eb0d7cc668 (diff) | |
download | infinitytier-21e6850722539d4ff72b6c5841da47356233bb67.tar.gz infinitytier-21e6850722539d4ff72b6c5841da47356233bb67.zip |
Cancel NAT-t attempts if peer is no longer "alive"
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r-- | node/Switch.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index bf9308b0..02881331 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -452,8 +452,8 @@ unsigned long Switch::doTimerTasks(uint64_t now) Mutex::Lock _l(_contactQueue_m); for(std::list<ContactQueueEntry>::iterator qi(_contactQueue.begin());qi!=_contactQueue.end();) { if (now >= qi->fireAtTime) { - if (qi->peer->hasActiveDirectPath(now)) { - // We've successfully NAT-t'd, so cancel attempt + if ((!qi->peer->alive(now))||(qi->peer->hasActiveDirectPath(now))) { + // Cancel attempt if we've already connected or peer is no longer "alive" _contactQueue.erase(qi++); continue; } else { |