Skip to content

Instantly share code, notes, and snippets.

@wozz
Created June 21, 2014 03:14
Show Gist options
  • Select an option

  • Save wozz/4d3ff0a3f4705370a908 to your computer and use it in GitHub Desktop.

Select an option

Save wozz/4d3ff0a3f4705370a908 to your computer and use it in GitHub Desktop.
txnotify patch
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 4f7b96e..519a841 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -590,6 +590,14 @@ bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction&
{
{
LOCK(cs_wallet);
+
+ std::string strCmd = GetArg("-txnotify", "");
+ if ( !strCmd.empty())
+ {
+ boost::replace_all(strCmd, "%s", tx.GetHash().GetHex());
+ boost::thread t(runCommand, strCmd); // thread runs free
+ }
+
bool fExisted = mapWallet.count(hash);
if (fExisted && !fUpdate) return false;
if (fExisted || IsMine(tx) || IsFromMe(tx))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment