X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwallet.cpp;h=7ddd67f9a6bb9fc5320f667e8a38cea548ff61ab;hb=77eabaa6e041aa8bfb0f5fc824811cff7abdfadf;hp=998857777fdd5be2ec9cc1f5374f2121bd6f1a13;hpb=5d2c41f9d678971c9b6fff9de6348a56d925720a;p=novacoin.git diff --git a/src/wallet.cpp b/src/wallet.cpp index 9988577..7ddd67f 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -9,6 +9,7 @@ #include "ui_interface.h" #include "base58.h" #include "kernel.h" +#include using namespace std; extern int nStakeMaxAge; @@ -501,6 +502,16 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) // Notify UI of new or updated transaction NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED); + + // notify an external script when a wallet transaction comes in or is updated + std::string strCmd = GetArg("-walletnotify", ""); + + if ( !strCmd.empty()) + { + boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex()); + boost::thread t(runCommand, strCmd); // thread runs free + } + } return true; }