Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inform and stop node if tier two initialization failed. #2756

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/tiertwo/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ bool LoadTierTwo(int chain_active_height, bool load_cache_files)
CFlatDB<CMasternodeMetaMan> 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());
}
}

Expand Down