Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 819 Lines • ▼ Show 20 Lines | bool CChainState::IsInitialBlockDownload() const { | ||||
return false; | return false; | ||||
} | } | ||||
static CBlockIndex const *pindexBestForkTip = nullptr; | static CBlockIndex const *pindexBestForkTip = nullptr; | ||||
static CBlockIndex const *pindexBestForkBase = nullptr; | static CBlockIndex const *pindexBestForkBase = nullptr; | ||||
static void AlertNotify(const std::string &strMessage) { | static void AlertNotify(const std::string &strMessage) { | ||||
uiInterface.NotifyAlertChanged(); | uiInterface.NotifyAlertChanged(); | ||||
#if defined(HAVE_SYSTEM) | |||||
std::string strCmd = gArgs.GetArg("-alertnotify", ""); | std::string strCmd = gArgs.GetArg("-alertnotify", ""); | ||||
if (strCmd.empty()) { | if (strCmd.empty()) { | ||||
return; | return; | ||||
} | } | ||||
// Alert text should be plain ascii coming from a trusted source, but to be | // Alert text should be plain ascii coming from a trusted source, but to be | ||||
// safe we first strip anything not in safeChars, then add single quotes | // safe we first strip anything not in safeChars, then add single quotes | ||||
// around the whole string before passing it to the shell: | // around the whole string before passing it to the shell: | ||||
std::string singleQuote("'"); | std::string singleQuote("'"); | ||||
std::string safeStatus = SanitizeString(strMessage); | std::string safeStatus = SanitizeString(strMessage); | ||||
safeStatus = singleQuote + safeStatus + singleQuote; | safeStatus = singleQuote + safeStatus + singleQuote; | ||||
boost::replace_all(strCmd, "%s", safeStatus); | boost::replace_all(strCmd, "%s", safeStatus); | ||||
std::thread t(runCommand, strCmd); | std::thread t(runCommand, strCmd); | ||||
// thread runs free | // thread runs free | ||||
t.detach(); | t.detach(); | ||||
#endif | |||||
} | } | ||||
static void CheckForkWarningConditions() EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | static void CheckForkWarningConditions() EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
// Before we get past initial download, we cannot reliably alert about forks | // Before we get past initial download, we cannot reliably alert about forks | ||||
// (we assume we don't get stuck on a fork before finishing our initial | // (we assume we don't get stuck on a fork before finishing our initial | ||||
// sync) | // sync) | ||||
if (::ChainstateActive().IsInitialBlockDownload()) { | if (::ChainstateActive().IsInitialBlockDownload()) { | ||||
▲ Show 20 Lines • Show All 4,778 Lines • Show Last 20 Lines |