aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp7
-rw-r--r--src/wallet/wallet.cpp2
2 files changed, 5 insertions, 4 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;
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 599e74149c..41ecec9b6b 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -988,7 +988,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
// notify an external script when a wallet transaction comes in or is updated
std::string strCmd = gArgs.GetArg("-walletnotify", "");
- if ( !strCmd.empty())
+ if (!strCmd.empty())
{
boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
boost::thread t(runCommand, strCmd); // thread runs free