diff options
| author | Matt Corallo <[email protected]> | 2013-05-07 18:37:37 +0200 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2013-07-22 12:11:46 +0200 |
| commit | f89faa258404d2e6fd4300990275cd2439e51255 (patch) | |
| tree | a24b2cdb8b80d31b872d4df9e65b538b873b14e9 /src/main.cpp | |
| parent | Detect any sufficiently long fork and add a warning. (diff) | |
| download | discoin-f89faa258404d2e6fd4300990275cd2439e51255.tar.xz discoin-f89faa258404d2e6fd4300990275cd2439e51255.zip | |
Call the -alertnotify script when we see a long or invalid fork.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2e79c874d..b206b6803 100644 --- a/src/main.cpp +++ b/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 |