Use relayID

This commit is contained in:
GUVWAF
2024-11-08 21:28:36 +01:00
parent 70aa28c53c
commit 78bf1e192b
2 changed files with 9 additions and 12 deletions

View File

@@ -54,9 +54,8 @@ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpd
// to handle it now
uint8_t ourRelayID = nodeDB->getLastByteOfNodeNum(nodeDB->getNodeNum());
if (found->sender != nodeDB->getNodeNum() && found->next_hop != NO_NEXT_HOP_PREFERENCE &&
p->next_hop == NO_NEXT_HOP_PREFERENCE && found->next_hop != nodeDB->getLastByteOfNodeNum(nodeDB->getNodeNum()) &&
p->relay_node != 0 && wasRelayer(p->relay_node, found) && !wasRelayer(ourRelayID, found) &&
!wasRelayer(found->next_hop, found)) {
p->next_hop == NO_NEXT_HOP_PREFERENCE && found->next_hop != ourRelayID && p->relay_node != 0 &&
wasRelayer(p->relay_node, found) && !wasRelayer(ourRelayID, found) && !wasRelayer(found->next_hop, found)) {
LOG_WARN("Fallback to flooding, consider unseen relay_node=0x%x", p->relay_node);
seenRecently = false;
}
@@ -160,4 +159,4 @@ void PacketHistory::removeRelayer(const uint8_t relayer, const uint32_t id, cons
recentPackets.erase(found);
recentPackets.insert(r);
}
}