Try fix repeatedly getting a new NodeNum (#4670)

This commit is contained in:
GUVWAF 2024-09-09 21:22:32 +02:00 committed by GitHub
parent 106dab23db
commit 4ed12bf21d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,6 +121,8 @@ NodeDB::NodeDB()
owner.hw_model = HW_VENDOR; owner.hw_model = HW_VENDOR;
// Ensure user (nodeinfo) role is set to whatever we're configured to // Ensure user (nodeinfo) role is set to whatever we're configured to
owner.role = config.device.role; owner.role = config.device.role;
// Ensure macaddr is set to our macaddr as it will be copied in our info below
memcpy(owner.macaddr, ourMacAddr, sizeof(owner.macaddr));
// Include our owner in the node db under our nodenum // Include our owner in the node db under our nodenum
meshtastic_NodeInfoLite *info = getOrCreateMeshNode(getNodeNum()); meshtastic_NodeInfoLite *info = getOrCreateMeshNode(getNodeNum());
@ -1194,4 +1196,4 @@ void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, co
LOG_ERROR("A critical failure occurred, portduino is exiting..."); LOG_ERROR("A critical failure occurred, portduino is exiting...");
exit(2); exit(2);
#endif #endif
} }