mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 14:01:10 +02:00
wallet: Remove IsFeatureSupported()
and CanSupportFeature()
This commit is contained in:
@@ -90,10 +90,8 @@ static RPCHelpMan getwalletinfo()
|
|||||||
obj.pushKV("format", pwallet->GetDatabase().Format());
|
obj.pushKV("format", pwallet->GetDatabase().Format());
|
||||||
obj.pushKV("txcount", (int)pwallet->mapWallet.size());
|
obj.pushKV("txcount", (int)pwallet->mapWallet.size());
|
||||||
obj.pushKV("keypoolsize", (int64_t)kpExternalSize);
|
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()) {
|
if (pwallet->IsCrypted()) {
|
||||||
obj.pushKV("unlocked_until", pwallet->nRelockTime);
|
obj.pushKV("unlocked_until", pwallet->nRelockTime);
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,6 @@ public:
|
|||||||
virtual WalletDatabase& GetDatabase() const = 0;
|
virtual WalletDatabase& GetDatabase() const = 0;
|
||||||
virtual bool IsWalletFlagSet(uint64_t) const = 0;
|
virtual bool IsWalletFlagSet(uint64_t) const = 0;
|
||||||
virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
|
virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
|
||||||
virtual bool CanSupportFeature(enum WalletFeature) const = 0;
|
|
||||||
virtual void SetMinVersion(enum WalletFeature, WalletBatch* = nullptr) = 0;
|
virtual void SetMinVersion(enum WalletFeature, WalletBatch* = nullptr) = 0;
|
||||||
//! Pass the encryption key to cb().
|
//! Pass the encryption key to cb().
|
||||||
virtual bool WithEncryptionKey(std::function<bool (const CKeyingMaterial&)> cb) const = 0;
|
virtual bool WithEncryptionKey(std::function<bool (const CKeyingMaterial&)> cb) const = 0;
|
||||||
|
@@ -556,9 +556,6 @@ public:
|
|||||||
int GetTxBlocksToMaturity(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
int GetTxBlocksToMaturity(const CWalletTx& wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
bool IsTxImmatureCoinBase(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);
|
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.
|
// Whether this or any known scriptPubKey with the same single key has been spent.
|
||||||
|
@@ -32,11 +32,6 @@ fs::path GetWalletDir()
|
|||||||
return path;
|
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)
|
WalletDescriptor GenerateWalletDescriptor(const CExtPubKey& master_key, const OutputType& addr_type, bool internal)
|
||||||
{
|
{
|
||||||
int64_t creation_time = GetTime();
|
int64_t creation_time = GetTime();
|
||||||
|
@@ -30,8 +30,6 @@ enum WalletFeature
|
|||||||
FEATURE_LATEST = FEATURE_PRE_SPLIT_KEYPOOL
|
FEATURE_LATEST = FEATURE_PRE_SPLIT_KEYPOOL
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsFeatureSupported(int wallet_version, int feature_version);
|
|
||||||
|
|
||||||
enum WalletFlags : uint64_t {
|
enum WalletFlags : uint64_t {
|
||||||
// wallet flags in the upper section (> 1 << 31) will lead to not opening the wallet if flag is unknown
|
// 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
|
// unknown wallet flags in the lower section <= (1 << 31) will be tolerated
|
||||||
|
Reference in New Issue
Block a user