From 757d02a600e0828b50f6c0f26d2e7d31b0bdb69b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 27 May 2015 16:00:56 -0700 Subject: [PATCH] fix reset on address lookup --- libraries/networking/src/LimitedNodeList.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 76bdc5d089..8133f1417c 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -866,14 +866,18 @@ void LimitedNodeList::flagTimeForConnectionStep(ConnectionStep connectionStep) { } void LimitedNodeList::flagTimeForConnectionStep(ConnectionStep connectionStep, quint64 timestamp) { - if (!_areConnectionTimesComplete) { + + if (connectionStep == ConnectionStep::LookupAddress) { + QWriteLocker writeLock(&_connectionTimeLock); + + // we clear the current times if the user just fired off a lookup + _lastConnectionTimes.clear(); + _areConnectionTimesComplete = false; + + _lastConnectionTimes[timestamp] = connectionStep; + } else if (!_areConnectionTimesComplete) { QWriteLocker writeLock(&_connectionTimeLock); - if (connectionStep == ConnectionStep::LookupAddress) { - // we clear the current times if the user just fired off a lookup - _lastConnectionTimes.clear(); - _areConnectionTimesComplete = false; - } // anything > than sending the first DS check should not come before the DS check in, so we drop those // this handles the case where you lookup an address and get packets in the existing domain before changing domains