fix crash during reset nodedb (#4017)

This commit is contained in:
Manuel 2024-06-02 14:38:20 +02:00 committed by GitHub
parent 6ce2fdc1c8
commit 2723ae6e9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -444,9 +444,9 @@ void NodeDB::installDefaultChannels()
void NodeDB::resetNodes()
{
clearLocalPosition();
numMeshNodes = 1;
std::fill(devicestate.node_db_lite.begin() + 1, devicestate.node_db_lite.end(), meshtastic_NodeInfoLite());
clearLocalPosition();
saveDeviceStateToDisk();
if (neighborInfoModule && moduleConfig.neighbor_info.enabled)
neighborInfoModule->resetNeighbors();