From e1f66de8d72f6fdb1163d7117038098107bed972 Mon Sep 17 00:00:00 2001 From: furszy Date: Mon, 7 Mar 2022 11:48:32 -0300 Subject: [PATCH 1/2] init: inform load tier two init error. --- src/init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 73dcb170b1020..dbd2f4c8d5ab8 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1724,7 +1724,9 @@ bool AppInitMain() } } - LoadTierTwo(chain_active_height, load_cache_files); + if (!LoadTierTwo(chain_active_height, load_cache_files)) { + return false; // error informed inside the function + } RegisterTierTwoValidationInterface(); // set the mode of budget voting for this node From f273603fd53a988dc5a56658ad88230b1321fe26 Mon Sep 17 00:00:00 2001 From: furszy Date: Mon, 7 Mar 2022 11:53:09 -0300 Subject: [PATCH 2/2] init: don't error out if MN metadata db wasn't loaded properly. the node will re-create its state all over. --- src/tiertwo/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tiertwo/init.cpp b/src/tiertwo/init.cpp index 68da9af0f5276..76f1ca13b3532 100644 --- a/src/tiertwo/init.cpp +++ b/src/tiertwo/init.cpp @@ -162,12 +162,12 @@ bool LoadTierTwo(int chain_active_height, bool load_cache_files) CFlatDB metadb(MN_META_CACHE_FILENAME, MN_META_CACHE_FILE_ID); if (load_cache_files) { if (!metadb.Load(g_mmetaman)) { - return UIError(strprintf(_("Failed to load masternode metadata cache from: %s"), metadb.GetDbPath().string())); + LogPrintf("Failed to load masternode metadata cache from: %s", metadb.GetDbPath().string()); } } else { CMasternodeMetaMan mmetamanTmp; if (!metadb.Dump(mmetamanTmp)) { - return UIError(strprintf(_("Failed to clear masternode metadata cache at: %s"), metadb.GetDbPath().string())); + LogPrintf("Failed to clear masternode metadata cache at: %s", metadb.GetDbPath().string()); } }