Changeset View
Changeset View
Standalone View
Standalone View
src/warnings.cpp
Show All 29 Lines | bool GetfLargeWorkForkFound() { | ||||
return fLargeWorkForkFound; | return fLargeWorkForkFound; | ||||
} | } | ||||
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(bool verbose) { | ||||
std::string strStatusBar; | std::string warnings_concise; | ||||
std::string strGUI; | std::string warnings_verbose; | ||||
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 " | warnings_concise = | ||||
"risk - do not use for mining or merchant applications"; | "This is a pre-release test build - use at your own risk - do not " | ||||
strGUI = _("This is a pre-release test build - use at your own risk - " | "use for mining or merchant applications"; | ||||
"do not use for mining or merchant applications") | warnings_verbose = | ||||
_("This is a pre-release test build - use at your own risk - do " | |||||
"not use for mining or merchant applications") | |||||
.translated; | .translated; | ||||
} | } | ||||
// 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; | warnings_concise = strMiscWarning; | ||||
strGUI += (strGUI.empty() ? "" : uiAlertSeperator) + strMiscWarning; | warnings_verbose += | ||||
(warnings_verbose.empty() ? "" : uiAlertSeperator) + strMiscWarning; | |||||
} | } | ||||
if (fLargeWorkForkFound) { | if (fLargeWorkForkFound) { | ||||
strStatusBar = "Warning: The network does not appear to fully agree! " | warnings_concise = | ||||
"Some miners appear to be experiencing issues."; | "Warning: The network does not appear to fully agree! Some miners " | ||||
strGUI += (strGUI.empty() ? "" : uiAlertSeperator) + | "appear to be experiencing issues."; | ||||
warnings_verbose += | |||||
(warnings_verbose.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.") | ||||
.translated; | .translated; | ||||
} else if (fLargeWorkInvalidChainFound) { | } else if (fLargeWorkInvalidChainFound) { | ||||
strStatusBar = "Warning: We do not appear to fully agree with our " | warnings_concise = | ||||
"peers! You may need to upgrade, or other nodes may " | "Warning: We do not appear to fully agree with our peers! You may " | ||||
"need to upgrade."; | "need to upgrade, or other nodes may need to upgrade."; | ||||
strGUI += | warnings_verbose += | ||||
(strGUI.empty() ? "" : uiAlertSeperator) + | (warnings_verbose.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.") | ||||
.translated; | .translated; | ||||
} | } | ||||
if (strFor == "gui") { | if (verbose) { | ||||
return strGUI; | return warnings_verbose; | ||||
} else if (strFor == "statusbar") { | } else { | ||||
return strStatusBar; | return warnings_concise; | ||||
} | } | ||||
assert(!"GetWarnings(): invalid parameter"); | |||||
return "error"; | |||||
} | } |