Skip favorite nodes when clearing out oldest in NodeDB (#3464)

* Skip favorite nodes when clearing out oldest in NodeDB

* We should actually map between the types
This commit is contained in:
Ben Meadors authored and GitHub committed 2024-03-21 19:51:02 -05:00
1 parent a57f7730ea
commit 7aa013a716
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -939,7 +939,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
uint32_t oldest = UINT32_MAX;
int oldestIndex = -1;
for (int i = 1; i < numMeshNodes; i++) {
if (meshNodes->at(i).last_heard < oldest) {
if (!meshNodes->at(i).is_favorite && meshNodes->at(i).last_heard < oldest) {
oldest = meshNodes->at(i).last_heard;
oldestIndex = i;
}