mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-25 22:40:15 +00:00
If packet traveled 1 hop, set relay_node
as next_hop
for the original transmitter
This commit is contained in:
parent
9b1dd75549
commit
27a492adf8
@ -795,6 +795,9 @@ void NodeDB::updateFrom(const meshtastic_MeshPacket &mp)
|
||||
// If this packet didn't travel any hops, then it was sent directly to us, so we know what to use as next hop to this node
|
||||
if (mp.original_hop_limit == mp.hop_limit) {
|
||||
info->next_hop = (uint8_t)(mp.from & 0xFF);
|
||||
} else if (mp.relay_node && (mp.original_hop_limit - mp.hop_limit == 1)) {
|
||||
// This packet traveled one hop, so we can use the relay_node as next_hop
|
||||
info->next_hop = (uint8_t)(mp.relay_node & 0xFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user