aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorTom Harding <tomh@thinlink.com>2014-06-26 18:31:40 -0700
committerTom Harding <tomh@thinlink.com>2014-06-27 07:54:21 -0700
commit9004798e62e987ddf50030b17fa1881b63dd5e45 (patch)
tree5434905c6482214d8dfd452843cae123a13a2087 /src/wallet.cpp
parentada5a067c75f19a724cc054286ecf2254e5dbe8f (diff)
Add -respendnotify option and new RPC data
-respendnotify=<cmd> Execute command when a network tx respends wallet tx input (%s=respend TxID, %t=wallet TxID) Add respendsobserved array to gettransaction, listtransactions, and listsinceblock RPCs. This omits the malleated clones that are included in the walletconflicts array. Add RPC help for respendsobserved and walletconflicts (help was missing for the latter).
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 79cc5ba3c9..91910c6ea9 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -600,6 +600,14 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
if (IsFromMe(txConflict) || IsMine(txConflict))
{
NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog
+ // external respend notify
+ std::string strCmd = GetArg("-respendnotify", "");
+ if (!strCmd.empty())
+ {
+ boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
+ boost::replace_all(strCmd, "%t", conflictHash.GetHex());
+ boost::thread t(runCommand, strCmd); // thread runs free
+ }
}
}
}