mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Refactor -alertnotify code
Refactor common -alertnotify code into static CAlert::Notify method.
This commit is contained in:
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user