aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2017-07-27 01:09:05 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2017-08-14 17:50:31 +0200
commit6fb8f5f17c079a7d32c855eae313c740e5f9e6be (patch)
treeacc3b720398d7736a6971c3619bc1dcea744d5d4 /src/init.cpp
parent140de14a12228cf7af44f59f40a937c2910a0158 (diff)
downloadbitcoin-6fb8f5f17c079a7d32c855eae313c740e5f9e6be.tar.xz
Check that -blocknotify command is non-empty before executing
To make BlockNotifyCallback(...) (-blocknotify) consistent with: * AlertNotify(...) (-alertnotify) * AddToWallet(...) (-walletnotify)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index d79c2967b9..873a87c009 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -547,9 +547,10 @@ static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex
return;
std::string strCmd = gArgs.GetArg("-blocknotify", "");
-
- boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex());
- boost::thread t(runCommand, strCmd); // thread runs free
+ if (!strCmd.empty()) {
+ boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex());
+ boost::thread t(runCommand, strCmd); // thread runs free
+ }
}
static bool fHaveGenesis = false;