Prevent ghost nodes during onboarding (#10647)
* Prevent ghost nodes during onboarding * Coplilot is exceptionally nit-picky today
This commit is contained in:
co-authored by
GitHub
parent
bfb833982e
commit
8c4900a52f
@@ -1989,6 +1989,14 @@ bool NodeDB::saveDeviceStateToDisk()
|
|||||||
|
|
||||||
bool NodeDB::saveNodeDatabaseToDisk()
|
bool NodeDB::saveNodeDatabaseToDisk()
|
||||||
{
|
{
|
||||||
|
// Don't persist the node DB until this device has a PKI keypair
|
||||||
|
// TODO: revisit when https://github.com/meshtastic/firmware/pull/10478 lands
|
||||||
|
#if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN || MESHTASTIC_EXCLUDE_PKI)
|
||||||
|
if (owner.public_key.size != 32 && !owner.is_licensed) {
|
||||||
|
LOG_DEBUG("Skip NodeDB without key");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
// do not try to save anything if power level is not safe. In many cases flash will be lock-protected
|
||||||
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
// and all writes will fail anyway. Device should be sleeping at this point anyway.
|
||||||
|
|||||||
Reference in New Issue
Block a user