kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix: Correctly compare hopStart and hopLimit for received packets
fixes: #1304 The calculation of `hopsAway` was using an incorrect comparison between `hopStart` and `hopLimit`. This commit fixes the logic to correctly determine the number of hops a packet has traveled.pull/1307/head
rodzic
cf2315cb66
commit
ed2703c77a
|
@ -1101,7 +1101,7 @@ class MeshService : Service(), Logging {
|
|||
it.rssi = packet.rxRssi
|
||||
|
||||
// Generate our own hopsAway, comparing hopStart to hopLimit.
|
||||
it.hopsAway = if (packet.hopStart == 0 || packet.hopLimit < packet.hopStart) {
|
||||
it.hopsAway = if (packet.hopStart == 0 || packet.hopLimit > packet.hopStart) {
|
||||
-1
|
||||
} else {
|
||||
packet.hopStart - packet.hopLimit
|
||||
|
|
Ładowanie…
Reference in New Issue