aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2018-04-22 17:19:03 +0100
committerRoss Nicoll <[email protected]>2018-09-19 22:11:47 +0100
commit41c868f47e671dc5009cd47496c39c13ae36306b (patch)
treee48b4f07bce4ff5aac8369551032dc46c46a8bf1 /src/validation.cpp
parentUpdate or eliminate remaining tests (#1483) (diff)
downloaddiscoin-41c868f47e671dc5009cd47496c39c13ae36306b.tar.xz
discoin-41c868f47e671dc5009cd47496c39c13ae36306b.zip
Re-introduce alert functionality (#1470)
Re-introduce alert functionality removed from Bitcoin upstream
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index c5041cea9..d80a5af91 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -5,6 +5,7 @@
#include "validation.h"
+#include "alert.h"
#include "arith_uint256.h"
#include "chainparams.h"
#include "checkpoints.h"
@@ -75,6 +76,7 @@ bool fCheckBlockIndex = false;
bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED;
size_t nCoinCacheUsage = 5000 * 300;
uint64_t nPruneTarget = 0;
+bool fAlerts = DEFAULT_ALERTS;
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
bool fEnableReplacement = DEFAULT_ENABLE_REPLACEMENT;
@@ -1232,19 +1234,7 @@ CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL;
static void AlertNotify(const std::string& strMessage)
{
- uiInterface.NotifyAlertChanged();
- std::string strCmd = GetArg("-alertnotify", "");
- if (strCmd.empty()) return;
-
- // Alert text should be plain ascii coming from a trusted source, but to
- // be safe we first strip anything not in safeChars, then add single quotes around
- // the whole string before passing it to the shell:
- std::string singleQuote("'");
- std::string safeStatus = SanitizeString(strMessage);
- safeStatus = singleQuote+safeStatus+singleQuote;
- boost::replace_all(strCmd, "%s", safeStatus);
-
- boost::thread t(runCommand, strCmd); // thread runs free
+ CAlert::Notify(strMessage);
}
void CheckForkWarningConditions()