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).
This commit is contained in:
Tom Harding
2014-06-26 18:31:40 -07:00
parent ada5a067c7
commit 9004798e62
4 changed files with 34 additions and 0 deletions

View File

@@ -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
}
}
}
}