Changeset View
Changeset View
Standalone View
Standalone View
src/warnings.cpp
Show All 29 Lines | |||||
void SetfLargeWorkInvalidChainFound(bool flag) { | void SetfLargeWorkInvalidChainFound(bool flag) { | ||||
LOCK(cs_warnings); | LOCK(cs_warnings); | ||||
fLargeWorkInvalidChainFound = flag; | fLargeWorkInvalidChainFound = flag; | ||||
} | } | ||||
std::string GetWarnings(const std::string &strFor) { | std::string GetWarnings(const std::string &strFor) { | ||||
std::string strStatusBar; | std::string strStatusBar; | ||||
std::string strRPC; | |||||
std::string strGUI; | std::string strGUI; | ||||
const std::string uiAlertSeperator = "<hr />"; | const std::string uiAlertSeperator = "<hr />"; | ||||
LOCK(cs_warnings); | LOCK(cs_warnings); | ||||
if (!CLIENT_VERSION_IS_RELEASE) { | if (!CLIENT_VERSION_IS_RELEASE) { | ||||
strStatusBar = "This is a pre-release test build - use at your own " | strStatusBar = "This is a pre-release test build - use at your own " | ||||
"risk - do not use for mining or merchant applications"; | "risk - do not use for mining or merchant applications"; | ||||
strGUI = _("This is a pre-release test build - use at your own risk - " | strGUI = _("This is a pre-release test build - use at your own risk - " | ||||
"do not use for mining or merchant applications"); | "do not use for mining or merchant applications"); | ||||
} | } | ||||
if (gArgs.GetBoolArg("-testsafemode", DEFAULT_TESTSAFEMODE)) | |||||
strStatusBar = strRPC = strGUI = "testsafemode enabled"; | |||||
// Misc warnings like out of disk space and clock is wrong | // Misc warnings like out of disk space and clock is wrong | ||||
if (strMiscWarning != "") { | if (strMiscWarning != "") { | ||||
strStatusBar = strMiscWarning; | strStatusBar = strMiscWarning; | ||||
strGUI += (strGUI.empty() ? "" : uiAlertSeperator) + strMiscWarning; | strGUI += (strGUI.empty() ? "" : uiAlertSeperator) + strMiscWarning; | ||||
} | } | ||||
if (fLargeWorkForkFound) { | if (fLargeWorkForkFound) { | ||||
strStatusBar = strRPC = "Warning: The network does not appear to fully " | strStatusBar = "Warning: The network does not appear to fully agree! " | ||||
"agree! Some miners appear to be experiencing " | "Some miners appear to be experiencing issues."; | ||||
"issues."; | |||||
strGUI += (strGUI.empty() ? "" : uiAlertSeperator) + | strGUI += (strGUI.empty() ? "" : uiAlertSeperator) + | ||||
_("Warning: The network does not appear to fully agree! Some " | _("Warning: The network does not appear to fully agree! Some " | ||||
"miners appear to be experiencing issues."); | "miners appear to be experiencing issues."); | ||||
} else if (fLargeWorkInvalidChainFound) { | } else if (fLargeWorkInvalidChainFound) { | ||||
strStatusBar = strRPC = "Warning: We do not appear to fully agree with " | strStatusBar = "Warning: We do not appear to fully agree with our " | ||||
"our peers! You may need to upgrade, or other " | "peers! You may need to upgrade, or other nodes may " | ||||
"nodes may need to upgrade."; | "need to upgrade."; | ||||
strGUI += | strGUI += | ||||
(strGUI.empty() ? "" : uiAlertSeperator) + | (strGUI.empty() ? "" : uiAlertSeperator) + | ||||
_("Warning: We do not appear to fully agree with our peers! You " | _("Warning: We do not appear to fully agree with our peers! You " | ||||
"may need to upgrade, or other nodes may need to upgrade."); | "may need to upgrade, or other nodes may need to upgrade."); | ||||
} | } | ||||
if (strFor == "gui") | if (strFor == "gui") | ||||
return strGUI; | return strGUI; | ||||
else if (strFor == "statusbar") | else if (strFor == "statusbar") | ||||
return strStatusBar; | return strStatusBar; | ||||
else if (strFor == "rpc") | |||||
return strRPC; | |||||
assert(!"GetWarnings(): invalid parameter"); | assert(!"GetWarnings(): invalid parameter"); | ||||
return "error"; | return "error"; | ||||
} | } |