| 1659 | CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL; |
| 1660 | |
| 1661 | static void AlertNotify(const std::string& strMessage, bool fThread) |
| 1662 | { |
| 1663 | uiInterface.NotifyAlertChanged(); |
| 1664 | std::string strCmd = GetArg("-alertnotify", ""); |
| 1665 | if (strCmd.empty()) return; |
| 1666 | |
| 1667 | // Alert text should be plain ascii coming from a trusted source, but to |
| 1668 | // be safe we first strip anything not in safeChars, then add single quotes around |
| 1669 | // the whole string before passing it to the shell: |
| 1670 | std::string singleQuote("'"); |
| 1671 | std::string safeStatus = SanitizeString(strMessage); |
| 1672 | safeStatus = singleQuote+safeStatus+singleQuote; |
| 1673 | boost::replace_all(strCmd, "%s", safeStatus); |
| 1674 | |
| 1675 | if (fThread) |
| 1676 | boost::thread t(runCommand, strCmd); // thread runs free |
| 1677 | else |
| 1678 | runCommand(strCmd); |
| 1679 | } |
| 1680 | |
| 1681 | void CheckForkWarningConditions() |
| 1682 | { |
no test coverage detected