From e01a7939d3a3b231f68ae2f36cbc4de0cf4d4999 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 7 Oct 2014 13:11:48 -0400 Subject: Refactor -alertnotify code Refactor common -alertnotify code into static CAlert::Notify method. --- src/main.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5d46c30a9b..106c336a83 100644 --- a/src/main.cpp +++ b/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) { -- cgit v1.2.3