diff options
| author | Tom Harding <[email protected]> | 2014-06-26 18:31:40 -0700 |
|---|---|---|
| committer | Tom Harding <[email protected]> | 2014-06-27 07:54:21 -0700 |
| commit | 9004798e62e987ddf50030b17fa1881b63dd5e45 (patch) | |
| tree | 5434905c6482214d8dfd452843cae123a13a2087 /src/wallet.cpp | |
| parent | UI to alert of respend attempt affecting wallet. (diff) | |
| download | discoin-9004798e62e987ddf50030b17fa1881b63dd5e45.tar.xz discoin-9004798e62e987ddf50030b17fa1881b63dd5e45.zip | |
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.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 79cc5ba3c..91910c6ea 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 + } } } } |