Skip to content

Commit

Permalink
Merge bitcoin#7958: Remove useless argument to AlertNotify.
Browse files Browse the repository at this point in the history
b02119e Remove useless argument to AlertNotify. (Pavel Janík)
  • Loading branch information
laanwj committed May 9, 2016
2 parents e29cfc4 + b02119e commit a68f56e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ bool fLargeWorkForkFound = false;
bool fLargeWorkInvalidChainFound = false;
CBlockIndex *pindexBestForkTip = NULL, *pindexBestForkBase = NULL;

static void AlertNotify(const std::string& strMessage, bool fThread)
static void AlertNotify(const std::string& strMessage)
{
uiInterface.NotifyAlertChanged();
std::string strCmd = GetArg("-alertnotify", "");
Expand All @@ -1607,10 +1607,7 @@ static void AlertNotify(const std::string& strMessage, bool fThread)
safeStatus = singleQuote+safeStatus+singleQuote;
boost::replace_all(strCmd, "%s", safeStatus);

if (fThread)
boost::thread t(runCommand, strCmd); // thread runs free
else
runCommand(strCmd);
boost::thread t(runCommand, strCmd); // thread runs free
}

void CheckForkWarningConditions()
Expand All @@ -1632,7 +1629,7 @@ void CheckForkWarningConditions()
{
std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") +
pindexBestForkBase->phashBlock->ToString() + std::string("'");
AlertNotify(warning, true);
AlertNotify(warning);
}
if (pindexBestForkTip && pindexBestForkBase)
{
Expand Down Expand Up @@ -2163,7 +2160,7 @@ void PartitionCheck(bool (*initialDownloadCheck)(), CCriticalSection& cs, const
if (!strWarning.empty())
{
strMiscWarning = strWarning;
AlertNotify(strWarning, true);
AlertNotify(strWarning);
lastAlertTime = now;
}
}
Expand Down Expand Up @@ -2598,7 +2595,7 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
if (state == THRESHOLD_ACTIVE) {
strMiscWarning = strprintf(_("Warning: unknown new rules activated (versionbit %i)"), bit);
if (!fWarned) {
AlertNotify(strMiscWarning, true);
AlertNotify(strMiscWarning);
fWarned = true;
}
} else {
Expand All @@ -2620,7 +2617,7 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
// strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
strMiscWarning = _("Warning: Unknown block versions being mined! It's possible unknown rules are in effect");
if (!fWarned) {
AlertNotify(strMiscWarning, true);
AlertNotify(strMiscWarning);
fWarned = true;
}
}
Expand Down

0 comments on commit a68f56e

Please sign in to comment.