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

Function AlertNotify

src/validation.cpp:1235–1251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233CBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr;
1234
1235static 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
1253static void CheckForkWarningConditions()
1254{

Callers 2

DoWarningFunction · 0.85

Calls 3

SanitizeStringFunction · 0.85
GetArgMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected