[build]: check std::system for -[alert|block|wallet]notify

Platforms such as iOs do not support launching a process
through system().
This commit is contained in:
Sjors Provoost
2019-03-14 11:30:37 +01:00
parent cc3ad56ff2
commit f874e14cd3
7 changed files with 19 additions and 1 deletions

View File

@@ -1008,6 +1008,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
// Notify UI of new or updated transaction
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
#if defined(HAVE_SYSTEM)
// notify an external script when a wallet transaction comes in or is updated
std::string strCmd = gArgs.GetArg("-walletnotify", "");
@@ -1017,6 +1018,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
std::thread t(runCommand, strCmd);
t.detach(); // thread runs free
}
#endif
return true;
}