From c097852ab09da020ea0600d02abd1bd0be2141b4 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 12 Mar 2021 15:45:28 +0800 Subject: [PATCH] SERIOUS BUG: we've been discarding devicestate when we should not --- proto | 2 +- src/mesh/NodeDB.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/proto b/proto index 5c1062ea..e63f9713 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 5c1062ea839f97cfc6d33d428a89d1702c39bd93 +Subproject commit e63f9713f73ea5c9308b7822602ea75f506b6b00 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 20a68776..1840aa36 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -145,6 +145,7 @@ void NodeDB::installDefaultDeviceState() devicestate.has_my_node = true; devicestate.has_owner = true; devicestate.node_db_count = 0; + devicestate.version = DEVICESTATE_CUR_VER; devicestate.receive_queue_count = 0; // Not yet implemented FIXME // default to no GPS, until one has been found by probing @@ -308,7 +309,7 @@ void NodeDB::loadFromDisk() installDefaultDeviceState(); // Our in RAM copy might now be corrupt } else { if (devicestate.version < DEVICESTATE_MIN_VER) { - DEBUG_MSG("Warn: devicestate is old, discarding\n"); + DEBUG_MSG("Warn: devicestate %d is old, discarding\n", devicestate.version); installDefaultDeviceState(); } else { DEBUG_MSG("Loaded saved preferences version %d\n", devicestate.version);