diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2014-06-30 08:35:12 -0400 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2014-06-30 08:35:12 -0400 |
commit | 8ceb28afc3799c765d1fce242d9c9472d5f4024c (patch) | |
tree | 39e751cf37191b98e399380e2517873ac1bd62bf /src/wallet.h | |
parent | 6fba25ef26649359d8e5962555c0d753b6df51b4 (diff) | |
parent | 7a19efe04069d9a1e251cdc94b25184f76d9d901 (diff) |
Merge pull request #3883 from dgenr8/first_double_spend
Relay and alert user to double spends
Diffstat (limited to 'src/wallet.h')
-rw-r--r-- | src/wallet.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/wallet.h b/src/wallet.h index 8494ce9a34..1c2512d678 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -141,6 +141,9 @@ public: MasterKeyMap mapMasterKeys; unsigned int nMasterKeyMaxID; + // Increment to cause UI refresh, similar to new block + int64_t nConflictsReceived; + CWallet() { SetNull(); @@ -163,6 +166,7 @@ public: nNextResend = 0; nLastResend = 0; nTimeFirstKey = 0; + nConflictsReceived = 0; } std::map<uint256, CWalletTx> mapWallet; @@ -305,6 +309,13 @@ public: { return (GetDebit(tx) > 0); } + bool IsConflicting(const CTransaction& tx) const + { + BOOST_FOREACH(const CTxIn& txin, tx.vin) + if (mapTxSpends.count(txin.prevout)) + return true; + return false; + } int64_t GetDebit(const CTransaction& tx) const { int64_t nDebit = 0; @@ -377,7 +388,7 @@ public: int GetVersion() { LOCK(cs_wallet); return nWalletVersion; } // Get wallet transactions that conflict with given transaction (spend same outputs) - std::set<uint256> GetConflicts(const uint256& txid) const; + std::set<uint256> GetConflicts(const uint256& txid, bool includeEquivalent) const; /** Address book entry changed. * @note called with lock cs_wallet held. @@ -699,7 +710,7 @@ public: void RelayWalletTransaction(); - std::set<uint256> GetConflicts() const; + std::set<uint256> GetConflicts(bool includeEquivalent=true) const; }; |