From fa7b7f796ac8cd99de19722af68a570b49f37939 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 13 May 2025 09:37:00 +0200 Subject: [PATCH 1/2] Remove HaveKey helper, unused after sethdseed removal --- src/wallet/rpc/wallet.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index 66b438865ce..2c07e4d5996 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -9,18 +9,17 @@ #include #include #include +#include #include #include #include -#include #include +#include #include #include #include -#include - namespace wallet { @@ -31,14 +30,6 @@ static const std::map WALLET_FLAG_CAVEATS{ "be considered unused, even if the opposite is the case."}, }; -/** Checks if a CKey is in the given CWallet compressed or otherwise*/ -bool HaveKey(const SigningProvider& wallet, const CKey& key) -{ - CKey key2; - key2.Set(key.begin(), key.end(), !key.IsCompressed()); - return wallet.HaveKey(key.GetPubKey().GetID()) || wallet.HaveKey(key2.GetPubKey().GetID()); -} - static RPCHelpMan getwalletinfo() { return RPCHelpMan{"getwalletinfo", From fabdc5ad06bce8cd3b0e525071d10f616a30bb04 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 13 May 2025 09:34:48 +0200 Subject: [PATCH 2/2] Remove unused LegacyDataSPKM::HaveWatchOnly() --- src/wallet/scriptpubkeyman.cpp | 8 +------- src/wallet/scriptpubkeyman.h | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 5422249ae1c..53ea904d052 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2022 The Bitcoin Core developers +// Copyright (c) 2019-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -343,12 +343,6 @@ bool LegacyDataSPKM::HaveWatchOnly(const CScript &dest) const return setWatchOnly.count(dest) > 0; } -bool LegacyDataSPKM::HaveWatchOnly() const -{ - LOCK(cs_KeyStore); - return (!setWatchOnly.empty()); -} - bool LegacyDataSPKM::LoadWatchOnly(const CScript &dest) { return AddWatchOnlyInMem(dest); diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index b52941227b2..d8aac3ed02f 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2022 The Bitcoin Core developers +// Copyright (c) 2019-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -241,8 +241,6 @@ public: bool LoadWatchOnly(const CScript &dest); //! Returns whether the watch-only script is in the wallet bool HaveWatchOnly(const CScript &dest) const; - //! Returns whether there are any watch-only things in the wallet - bool HaveWatchOnly() const; //! Adds a key to the store, without saving it to disk (used by LoadWallet) bool LoadKey(const CKey& key, const CPubKey &pubkey); //! Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)