From d952da8b1e1a2b1184dcc42c265574537858909f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 11 Dec 2023 15:44:32 +0100 Subject: [PATCH] make sure the queue stays in te same order the memory pool can NOT be iterated easily, since it's not a linear object. --- src/mesh/MeshService.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 231ba3ac28..9101712d1b 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -146,12 +146,12 @@ NodeNum MeshService::getNodenumFromRequestId(uint32_t request_id) NodeNum nodenum = 0; for (int i = 0; i < toPhoneQueue.numUsed(); i++) { meshtastic_MeshPacket *p = toPhoneQueue.dequeuePtr(0); - // put it right back on the queue - toPhoneQueue.enqueue(p, 0); if (p->id == request_id) { nodenum = p->to; - break; + // make sure to continue this to make one full loop } + // put it right back on the queue + toPhoneQueue.enqueue(p, 0); } return nodenum; }