mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Call the -alertnotify script when we see a long or invalid fork.
This commit is contained in:
parent
b8585384da
commit
f89faa2584
2 changed files with 11 additions and 1 deletions
10
src/main.cpp
10
src/main.cpp
|
|
@ -1395,6 +1395,16 @@ void CheckForkWarningConditions()
|
|||
|
||||
if (pindexBestForkTip || nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())
|
||||
{
|
||||
if (!fLargeWorkForkFound)
|
||||
{
|
||||
std::string strCmd = GetArg("-alertnotify", "");
|
||||
if (!strCmd.empty())
|
||||
{
|
||||
std::string warning("'Warning: Large-work fork detected. You may need to upgrade, or other nodes may need to upgrade.'");
|
||||
boost::replace_all(strCmd, "%s", warning);
|
||||
boost::thread t(runCommand, strCmd); // thread runs free
|
||||
}
|
||||
}
|
||||
fLargeWorkForkFound = true;
|
||||
printf("CheckForkWarningConditions: Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n");
|
||||
} else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue