mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Refactor -alertnotify code
Refactor common -alertnotify code into static CAlert::Notify method.
This commit is contained in:
parent
7c6cbff0e5
commit
e01a7939d3
3 changed files with 26 additions and 25 deletions
11
src/main.cpp
11
src/main.cpp
|
|
@ -1178,14 +1178,9 @@ void CheckForkWarningConditions()
|
|||
{
|
||||
if (!fLargeWorkForkFound)
|
||||
{
|
||||
std::string strCmd = GetArg("-alertnotify", "");
|
||||
if (!strCmd.empty())
|
||||
{
|
||||
std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") +
|
||||
pindexBestForkBase->phashBlock->ToString() + std::string("'");
|
||||
boost::replace_all(strCmd, "%s", warning);
|
||||
boost::thread t(runCommand, strCmd); // thread runs free
|
||||
}
|
||||
std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") +
|
||||
pindexBestForkBase->phashBlock->ToString() + std::string("'");
|
||||
CAlert::Notify(warning, true);
|
||||
}
|
||||
if (pindexBestForkTip)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue