| 1233 | CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr; |
| 1234 | |
| 1235 | static void AlertNotify(const std::string& strMessage) |
| 1236 | { |
| 1237 | uiInterface.NotifyAlertChanged(); |
| 1238 | std::string strCmd = gArgs.GetArg("-alertnotify", ""); |
| 1239 | if (strCmd.empty()) return; |
| 1240 | |
| 1241 | // Alert text should be plain ascii coming from a trusted source, but to |
| 1242 | // be safe we first strip anything not in safeChars, then add single quotes around |
| 1243 | // the whole string before passing it to the shell: |
| 1244 | std::string singleQuote("'"); |
| 1245 | std::string safeStatus = SanitizeString(strMessage); |
| 1246 | safeStatus = singleQuote+safeStatus+singleQuote; |
| 1247 | boost::replace_all(strCmd, "%s", safeStatus); |
| 1248 | |
| 1249 | std::thread t(runCommand, strCmd); |
| 1250 | t.detach(); // thread runs free |
| 1251 | } |
| 1252 | |
| 1253 | static void CheckForkWarningConditions() |
| 1254 | { |
no test coverage detected