mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-21 09:17:29 +00:00
Add evicted age and accessor in NodeDB
This commit is contained in:
@@ -2029,6 +2029,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
||||
}
|
||||
// if we found a "boring" node, evict it
|
||||
if (oldestBoringIndex != -1) {
|
||||
evictedAge = sinceLastSeen(&meshNodes->at(oldestBoringIndex));
|
||||
oldestIndex = oldestBoringIndex;
|
||||
}
|
||||
|
||||
@@ -2040,6 +2041,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
||||
(numMeshNodes)--;
|
||||
}
|
||||
}
|
||||
LOG_WARN("Evicted node %u secs old", evictedAge);
|
||||
// add the node at the end
|
||||
lite = &meshNodes->at((numMeshNodes)++);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user