Skip to content

Commit

Permalink
Skip favorite nodes when clearing out oldest in NodeDB
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern committed Mar 21, 2024
1 parent a57f773 commit b31146f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b31146f

Please sign in to comment.