Skip to content

Commit

Permalink
Add -confirmnotify
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed May 28, 2014
1 parent 58dd3de commit 3bc938d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ std::string HelpMessage()
" -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" +
" -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" +
" -newtxnotify=<cmd> " + _("Execute command when a new wallet transaction occurs (%s in cmd is replaced by TxID)") + "\n" +
" -confirmnotify=<cmd> " + _("Execute command when a wallet transaction is confirmed (%s in cmd is replaced by TxID)") + "\n" +
" -confchange " + _("Require a confirmations for change (default: 0)") + "\n" +
" -enforcecanonical " + _("Enforce transaction scripts to use canonical PUSH operators (default: 1)") + "\n" +
" -upgradewallet " + _("Upgrade wallet to latest format") + "\n" +
Expand Down
8 changes: 8 additions & 0 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,14 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
boost::replace_all(strCmdNewNotify, "%s", wtxIn.GetHash().GetHex());
boost::thread t(runCommand, strCmdNewNotify); // thread runs free
}

// notify an external script when a wallet transaction is confirmed
std::string strCmdConfNotify = GetArg("-confirmnotify", "");
if ( !strCmdConfNotify.empty() && fUpdated)
{
boost::replace_all(strCmdConfNotify, "%s", wtxIn.GetHash().GetHex());
boost::thread t(runCommand, strCmdConfNotify); // thread runs free
}
}
return true;
}
Expand Down

0 comments on commit 3bc938d

Please sign in to comment.