From ede6c9253b8b2a4b1c592d63cc54f624f31b9706 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Fri, 22 Nov 2024 02:48:40 +1300 Subject: [PATCH] use new helper function to determine hops --- src/js/Connection.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/js/Connection.js b/src/js/Connection.js index a78dd46..683355e 100644 --- a/src/js/Connection.js +++ b/src/js/Connection.js @@ -278,11 +278,6 @@ class Connection { const rxTime = data.rxTime; const fromNodeId = data.from; - // determine hops away - const hopStart = data.hopStart; - const hopLimit = data.hopLimit; - const hopsAway = (hopStart === 0 || hopLimit > hopStart) ? -1 : hopStart - hopLimit; - // find node by id or do nothing const node = GlobalState.nodesById[fromNodeId]; if(!node){ @@ -291,7 +286,7 @@ class Connection { // update last heard and hops away for the node we received packet from node.lastHeard = rxTime; - node.hopsAway = hopsAway; + node.hopsAway = PacketUtils.getPacketHops(data); });