mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 02:31:05 +02:00
Merge bitcoin/bitcoin#32476: refactor: Remove unused HaveKey and HaveWatchOnly
fabdc5ad06
Remove unused LegacyDataSPKM::HaveWatchOnly() (MarcoFalke)fa7b7f796a
Remove HaveKey helper, unused after sethdseed removal (MarcoFalke) Pull request description: removes some dead code ACKs for top commit: Sjors: utACKfabdc5ad06
Tree-SHA512: 3cf6838eff6cedfe6a7337071d41e17d34033a2875b3661a6a1741e13c7a8e81b57eb874aebbb9d96d05ea7efa261a3a98e1bcf982b12cfafb163405d860b8bf
This commit is contained in:
@ -9,18 +9,17 @@
|
|||||||
#include <key_io.h>
|
#include <key_io.h>
|
||||||
#include <rpc/server.h>
|
#include <rpc/server.h>
|
||||||
#include <rpc/util.h>
|
#include <rpc/util.h>
|
||||||
|
#include <univalue.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <wallet/context.h>
|
#include <wallet/context.h>
|
||||||
#include <wallet/receive.h>
|
#include <wallet/receive.h>
|
||||||
#include <wallet/rpc/wallet.h>
|
|
||||||
#include <wallet/rpc/util.h>
|
#include <wallet/rpc/util.h>
|
||||||
|
#include <wallet/rpc/wallet.h>
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
#include <wallet/walletutil.h>
|
#include <wallet/walletutil.h>
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
#include <univalue.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace wallet {
|
namespace wallet {
|
||||||
|
|
||||||
@ -31,14 +30,6 @@ static const std::map<uint64_t, std::string> WALLET_FLAG_CAVEATS{
|
|||||||
"be considered unused, even if the opposite is the case."},
|
"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()
|
static RPCHelpMan getwalletinfo()
|
||||||
{
|
{
|
||||||
return RPCHelpMan{"getwalletinfo",
|
return RPCHelpMan{"getwalletinfo",
|
||||||
|
@ -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
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// 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;
|
return setWatchOnly.count(dest) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LegacyDataSPKM::HaveWatchOnly() const
|
|
||||||
{
|
|
||||||
LOCK(cs_KeyStore);
|
|
||||||
return (!setWatchOnly.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LegacyDataSPKM::LoadWatchOnly(const CScript &dest)
|
bool LegacyDataSPKM::LoadWatchOnly(const CScript &dest)
|
||||||
{
|
{
|
||||||
return AddWatchOnlyInMem(dest);
|
return AddWatchOnlyInMem(dest);
|
||||||
|
@ -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
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@ -241,8 +241,6 @@ public:
|
|||||||
bool LoadWatchOnly(const CScript &dest);
|
bool LoadWatchOnly(const CScript &dest);
|
||||||
//! Returns whether the watch-only script is in the wallet
|
//! Returns whether the watch-only script is in the wallet
|
||||||
bool HaveWatchOnly(const CScript &dest) const;
|
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)
|
//! Adds a key to the store, without saving it to disk (used by LoadWallet)
|
||||||
bool LoadKey(const CKey& key, const CPubKey &pubkey);
|
bool LoadKey(const CKey& key, const CPubKey &pubkey);
|
||||||
//! Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
|
//! Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
|
||||||
|
Reference in New Issue
Block a user