Merge pull request #19 from lateminer/ui-respendalert

UI to alert of respend attempt affecting wallet.
This commit is contained in:
janko33bd
2018-01-09 21:34:03 +01:00
committed by GitHub
9 changed files with 74 additions and 14 deletions

View File

@@ -1196,6 +1196,20 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD
// Notify UI of new or updated transaction
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
// Notifications for existing transactions that now have conflicts with this one
if (fInsertedNew)
{
BOOST_FOREACH(const uint256& conflictHash, wtxIn.GetConflicts())
{
CWalletTx& txConflict = mapWallet[conflictHash];
NotifyTransactionChanged(this, conflictHash, CT_UPDATED); //Updates UI table
if (IsFromMe(txConflict) || IsMine(txConflict))
{
NotifyTransactionChanged(this, conflictHash, CT_GOT_CONFLICT); //Throws dialog
}
}
}
// notify an external script when a wallet transaction comes in or is updated
std::string strCmd = GetArg("-walletnotify", "");