wallet: Remove IsFeatureSupported() and CanSupportFeature()

This commit is contained in:
woltx
2025-07-15 00:56:53 -07:00
committed by w0xlt
parent ba01585229
commit 7cda3d0f5b
5 changed files with 1 additions and 14 deletions

View File

@@ -90,10 +90,8 @@ static RPCHelpMan getwalletinfo()
obj.pushKV("format", pwallet->GetDatabase().Format());
obj.pushKV("txcount", (int)pwallet->mapWallet.size());
obj.pushKV("keypoolsize", (int64_t)kpExternalSize);
obj.pushKV("keypoolsize_hd_internal", pwallet->GetKeyPoolSize() - kpExternalSize);
if (pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) {
obj.pushKV("keypoolsize_hd_internal", (int64_t)(pwallet->GetKeyPoolSize() - kpExternalSize));
}
if (pwallet->IsCrypted()) {
obj.pushKV("unlocked_until", pwallet->nRelockTime);
}

View File

@@ -47,7 +47,6 @@ public:
virtual WalletDatabase& GetDatabase() const = 0;
virtual bool IsWalletFlagSet(uint64_t) const = 0;
virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
virtual bool CanSupportFeature(enum WalletFeature) const = 0;
virtual void SetMinVersion(enum WalletFeature, WalletBatch* = nullptr) = 0;
//! Pass the encryption key to cb().
virtual bool WithEncryptionKey(std::function<bool (const CKeyingMaterial&)> cb) const = 0;

View File

@@ -556,9 +556,6 @@ public:
int GetTxBlocksToMaturity(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
bool IsTxImmatureCoinBase(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
//! check whether we support the named feature
bool CanSupportFeature(enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); return IsFeatureSupported(nWalletVersion, wf); }
bool IsSpent(const COutPoint& outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
// Whether this or any known scriptPubKey with the same single key has been spent.

View File

@@ -32,11 +32,6 @@ fs::path GetWalletDir()
return path;
}
bool IsFeatureSupported(int wallet_version, int feature_version)
{
return wallet_version >= feature_version;
}
WalletDescriptor GenerateWalletDescriptor(const CExtPubKey& master_key, const OutputType& addr_type, bool internal)
{
int64_t creation_time = GetTime();

View File

@@ -30,8 +30,6 @@ enum WalletFeature
FEATURE_LATEST = FEATURE_PRE_SPLIT_KEYPOOL
};
bool IsFeatureSupported(int wallet_version, int feature_version);
enum WalletFlags : uint64_t {
// wallet flags in the upper section (> 1 << 31) will lead to not opening the wallet if flag is unknown
// unknown wallet flags in the lower section <= (1 << 31) will be tolerated