mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 13:13:49 +01:00
wallet: Add utility method for CanSupportFeature
This commit is contained in:
@@ -801,7 +801,7 @@ public:
|
|||||||
bool IsTrusted(const CWalletTx& wtx, std::set<uint256>& trusted_parents) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
bool IsTrusted(const CWalletTx& wtx, std::set<uint256>& trusted_parents) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||||
|
|
||||||
//! check whether we are allowed to upgrade (or already support) to the named feature
|
//! check whether we are allowed to upgrade (or already support) to the named feature
|
||||||
bool CanSupportFeature(enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; }
|
bool CanSupportFeature(enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); return IsFeatureSupported(nWalletMaxVersion, wf); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* populate vCoins with vector of available COutputs.
|
* populate vCoins with vector of available COutputs.
|
||||||
|
|||||||
@@ -70,3 +70,8 @@ std::vector<fs::path> ListWalletDir()
|
|||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsFeatureSupported(int wallet_version, int feature_version)
|
||||||
|
{
|
||||||
|
return wallet_version >= feature_version;
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ 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
|
||||||
|
|||||||
Reference in New Issue
Block a user