Merge bitcoin/bitcoin#32977: wallet: Remove wallet version and several legacy related functions

60d1042b9a wallet: Remove unused `WalletFeature` enums (woltx)
66de58208a wallet: Remove `CWallet::nWalletVersion` and related functions (woltx)
7cda3d0f5b wallet: Remove `IsFeatureSupported()` and `CanSupportFeature()` (woltx)
ba01585229 wallet: `MigrateToDescriptor` no longer calls `CanSupportFeature` (woltx)
63acee2797 wallet: Remove `GetClosestWalletFeature()` (woltx)
e27da3150b wallet: Remove `GetVersion()` (woltx)

Pull request description:

  This PR incorporates the suggestion provided by PRabahy and pablomartin4btc in https://github.com/bitcoin/bitcoin/pull/32944 of removing `CWallet::nWalletVersion` and several related functions, such as `SetMinVersion()`, `GetVersion()`, `GetClosestWalletFeature()`, `IsFeatureSupported()`, `CanSupportFeature()`, etc ...

  This field is no longer used in the descriptor wallet and there is still a lot of code related to it, so the changes here provide a good cleanup in the wallet code.

  Built on top of https://github.com/bitcoin/bitcoin/pull/32944

ACKs for top commit:
  maflcko:
    review ACK 60d1042b9a 🐾
  achow101:
    ACK 60d1042b9a
  pablomartin4btc:
    ACK 60d1042b9a

Tree-SHA512: 1a7ad8e15d57df8f66545776e7d178a2cd5312c87769a29770588375e3de5f24247aab9919acf004ed3eca16d08ba595b5f1c7b2b3eef7752e89d9c295624583
This commit is contained in:
Ava Chow
2025-08-15 16:38:19 -07:00
12 changed files with 11 additions and 108 deletions

View File

@@ -624,10 +624,13 @@ std::optional<MigrationData> LegacyDataSPKM::MigrateToDescriptor()
for (const auto& chain_pair : m_inactive_hd_chains) {
chains.push_back(chain_pair.second);
}
bool can_support_hd_split_feature = m_hd_chain.nVersion >= CHDChain::VERSION_HD_CHAIN_SPLIT;
for (const CHDChain& chain : chains) {
for (int i = 0; i < 2; ++i) {
// Skip if doing internal chain and split chain is not supported
if (chain.seed_id.IsNull() || (i == 1 && !m_storage.CanSupportFeature(FEATURE_HD_SPLIT))) {
if (chain.seed_id.IsNull() || (i == 1 && !can_support_hd_split_feature)) {
continue;
}
// Get the master xprv