Skip to content

Commit

Permalink
use new helper function to determine hops
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Nov 21, 2024
1 parent 8966f5b commit ede6c92
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/js/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -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);

});

Expand Down

0 comments on commit ede6c92

Please sign in to comment.