mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* ID hash 0x00 and 0xFF now reserved for future.
This commit is contained in:
parent
86a3f592b9
commit
9498d2e824
4 changed files with 16 additions and 0 deletions
|
|
@ -228,6 +228,10 @@ class MyMesh : public BaseChatMesh {
|
|||
void loadMainIdentity() {
|
||||
if (!_identity_store->load("_main", self_id)) {
|
||||
self_id = radio_new_identity(); // create new random identity
|
||||
int count = 0;
|
||||
while (count < 10 && (self_id.pub_key[0] == 0x00 || self_id.pub_key[0] == 0xFF)) { // reserved id hashes
|
||||
self_id = radio_new_identity(); count++;
|
||||
}
|
||||
saveMainIdentity(self_id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue