clean up ack packets

This commit is contained in:
Kevin Hester
2021-02-26 20:36:22 +08:00
parent 0307e4161e
commit 989f52494d
8 changed files with 23 additions and 32 deletions

View File

@@ -65,8 +65,8 @@ void ReliableRouter::sniffReceived(const MeshPacket *p, const Routing *c)
// If the payload is valid, look for ack/nak
if (c) {
PacketId ackId = c->success_id;
PacketId nakId = c->fail_id;
PacketId ackId = c->error_reason == Routing_Error_NONE ? p->decoded.request_id : 0;
PacketId nakId = c->error_reason != Routing_Error_NONE ? p->decoded.request_id : 0;
// We intentionally don't check wasSeenRecently, because it is harmless to delete non existent retransmission records
if (ackId || nakId) {