diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -450,7 +450,7 @@ // RelayWalletTransaction may only be called if fBroadcastTransactions! bool RelayWalletTransaction(CConnman *connman); - std::set GetConflicts() const; + std::set GetConflicts() const; }; class COutput { @@ -622,7 +622,7 @@ * Used to keep track of spent outpoints, and detect and report conflicts * (double-spends or mutated transactions where the mutant gets mined). */ - typedef std::multimap TxSpends; + typedef std::multimap TxSpends; TxSpends mapTxSpends; void AddToSpends(const COutPoint &outpoint, const TxId &wtxid); void AddToSpends(const TxId &wtxid); @@ -1050,7 +1050,7 @@ //! Get wallet transactions that conflict with given transaction (spend same //! outputs) - std::set GetConflicts(const uint256 &txid) const; + std::set GetConflicts(const TxId &txid) const; //! Check if a given transaction has any of its outputs spent by another //! transaction in the wallet diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -535,8 +535,8 @@ return true; } -std::set CWallet::GetConflicts(const uint256 &txid) const { - std::set result; +std::set CWallet::GetConflicts(const TxId &txid) const { + std::set result; AssertLockHeld(cs_wallet); std::map::const_iterator it = mapWallet.find(txid); @@ -1825,12 +1825,12 @@ return false; } -std::set CWalletTx::GetConflicts() const { - std::set result; +std::set CWalletTx::GetConflicts() const { + std::set result; if (pwallet != nullptr) { - uint256 myHash = GetId(); - result = pwallet->GetConflicts(myHash); - result.erase(myHash); + const TxId &txid = GetId(); + result = pwallet->GetConflicts(txid); + result.erase(txid); } return result;