From 639dbea25b98a2264fde74d1425c80a118d0d98a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 1 Sep 2015 13:22:44 -0700 Subject: [PATCH] Move lastHeardMicroStamp to be updated when filtering packets --- libraries/networking/src/LimitedNodeList.cpp | 4 ++++ libraries/networking/src/PacketReceiver.cpp | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index d874921ada..e2d809a863 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -226,6 +226,10 @@ bool LimitedNodeList::packetSourceAndHashMatch(const udt::Packet& packet) { return false; } } + + // No matter if this packet is handled or not, we update the timestamp for the last time we heard + // from this sending node + matchingNode->setLastHeardMicrostamp(usecTimestampNow()); return true; diff --git a/libraries/networking/src/PacketReceiver.cpp b/libraries/networking/src/PacketReceiver.cpp index 03827d19af..fb1e2d896f 100644 --- a/libraries/networking/src/PacketReceiver.cpp +++ b/libraries/networking/src/PacketReceiver.cpp @@ -258,12 +258,6 @@ void PacketReceiver::handleVerifiedPacketList(std::unique_ptr p if (!nlPacketList->getSourceID().isNull()) { matchingNode = nodeList->nodeWithUUID(nlPacketList->getSourceID()); - - if (matchingNode) { - // No matter if this packet is handled or not, we update the timestamp for the last time we heard - // from this sending node - matchingNode->setLastHeardMicrostamp(usecTimestampNow()); - } } QMutexLocker packetListenerLocker(&_packetListenerLock); @@ -384,12 +378,6 @@ void PacketReceiver::handleVerifiedPacket(std::unique_ptr packet) { if (!nlPacket->getSourceID().isNull()) { matchingNode = nodeList->nodeWithUUID(nlPacket->getSourceID()); - - if (matchingNode) { - // No matter if this packet is handled or not, we update the timestamp for the last time we heard - // from this sending node - matchingNode->setLastHeardMicrostamp(usecTimestampNow()); - } } QMutexLocker packetListenerLocker(&_packetListenerLock);