MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / AlertNotify

Function AlertNotify

src/main.cpp:1661–1679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL;
1660
1661static 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
1681void CheckForkWarningConditions()
1682{

Callers 3

PartitionCheckFunction · 0.85
UpdateTipFunction · 0.85

Calls 3

GetArgFunction · 0.85
SanitizeStringFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected