From cdf185ccfb2085e5a4bf82d833392d74b748aeff Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 27 Apr 2022 11:08:53 -0300 Subject: [PATCH] wallet: remove unused IsSpentKey(hash, index) method --- src/wallet/wallet.cpp | 9 --------- src/wallet/wallet.h | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 57abc6fb19..679fedca50 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -906,15 +906,6 @@ void CWallet::SetSpentKeyState(WalletBatch& batch, const uint256& hash, unsigned } } -bool CWallet::IsSpentKey(const uint256& hash, unsigned int n) const -{ - AssertLockHeld(cs_wallet); - const CWalletTx* srctx = GetWalletTx(hash); - if (!srctx) return false; - assert(srctx->tx->vout.size() > n); - return IsSpentKey(srctx->tx->vout[n].scriptPubKey); -} - bool CWallet::IsSpentKey(const CScript& scriptPubKey) const { AssertLockHeld(cs_wallet); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 61b59e7895..a75b6981e1 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -443,8 +443,7 @@ public: bool IsSpent(const COutPoint& outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); - // Whether this or any known UTXO with the same single key has been spent. - bool IsSpentKey(const uint256& hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + // Whether this or any known scriptPubKey with the same single key has been spent. bool IsSpentKey(const CScript& scriptPubKey) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); void SetSpentKeyState(WalletBatch& batch, const uint256& hash, unsigned int n, bool used, std::set& tx_destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);