Skip to content

Commit 7cda3d0

Browse files
committed
wallet: Remove IsFeatureSupported() and CanSupportFeature()
1 parent ba01585 commit 7cda3d0

File tree

5 files changed

+1
-14
lines changed

5 files changed

+1
-14
lines changed

src/wallet/rpc/wallet.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ static RPCHelpMan getwalletinfo()
9090
obj.pushKV("format", pwallet->GetDatabase().Format());
9191
obj.pushKV("txcount", (int)pwallet->mapWallet.size());
9292
obj.pushKV("keypoolsize", (int64_t)kpExternalSize);
93+
obj.pushKV("keypoolsize_hd_internal", pwallet->GetKeyPoolSize() - kpExternalSize);
9394

94-
if (pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) {
95-
obj.pushKV("keypoolsize_hd_internal", (int64_t)(pwallet->GetKeyPoolSize() - kpExternalSize));
96-
}
9795
if (pwallet->IsCrypted()) {
9896
obj.pushKV("unlocked_until", pwallet->nRelockTime);
9997
}

src/wallet/scriptpubkeyman.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class WalletStorage
4747
virtual WalletDatabase& GetDatabase() const = 0;
4848
virtual bool IsWalletFlagSet(uint64_t) const = 0;
4949
virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
50-
virtual bool CanSupportFeature(enum WalletFeature) const = 0;
5150
virtual void SetMinVersion(enum WalletFeature, WalletBatch* = nullptr) = 0;
5251
//! Pass the encryption key to cb().
5352
virtual bool WithEncryptionKey(std::function<bool (const CKeyingMaterial&)> cb) const = 0;

src/wallet/wallet.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,6 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
556556
int GetTxBlocksToMaturity(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
557557
bool IsTxImmatureCoinBase(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
558558

559-
//! check whether we support the named feature
560-
bool CanSupportFeature(enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); return IsFeatureSupported(nWalletVersion, wf); }
561-
562559
bool IsSpent(const COutPoint& outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
563560

564561
// Whether this or any known scriptPubKey with the same single key has been spent.

src/wallet/walletutil.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ fs::path GetWalletDir()
3232
return path;
3333
}
3434

35-
bool IsFeatureSupported(int wallet_version, int feature_version)
36-
{
37-
return wallet_version >= feature_version;
38-
}
39-
4035
WalletDescriptor GenerateWalletDescriptor(const CExtPubKey& master_key, const OutputType& addr_type, bool internal)
4136
{
4237
int64_t creation_time = GetTime();

src/wallet/walletutil.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ enum WalletFeature
3030
FEATURE_LATEST = FEATURE_PRE_SPLIT_KEYPOOL
3131
};
3232

33-
bool IsFeatureSupported(int wallet_version, int feature_version);
34-
3533
enum WalletFlags : uint64_t {
3634
// wallet flags in the upper section (> 1 << 31) will lead to not opening the wallet if flag is unknown
3735
// unknown wallet flags in the lower section <= (1 << 31) will be tolerated

0 commit comments

Comments
 (0)