Browse Source

Merge #8366: [0.13] [Wallet] Ensure <0.13 clients can't open HD wallets

3b38a6a [Wallet] Ensure <0.13 clients can't open HD wallets (Jonas Schnelli)
0.13
Wladimir J. van der Laan 8 years ago
parent
commit
24f117ef05
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      doc/release-notes.md
  2. 3
      src/wallet/wallet.cpp
  3. 3
      src/wallet/wallet.h

2
doc/release-notes.md

@ -142,6 +142,8 @@ You can't disable HD key generation once you have created a HD wallet. @@ -142,6 +142,8 @@ You can't disable HD key generation once you have created a HD wallet.
There is no distinction between internal (change) and external keys.
HD wallets are incompatible with older versions of Bitcoin Core.
[Pull request](https://github.com/bitcoin/bitcoin/pull/8035/files), [BIP 32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)
Low-level P2P changes

3
src/wallet/wallet.cpp

@ -3299,6 +3299,9 @@ bool CWallet::InitLoadWallet() @@ -3299,6 +3299,9 @@ bool CWallet::InitLoadWallet()
key.MakeNewKey(true);
if (!walletInstance->SetHDMasterKey(key))
throw std::runtime_error("CWallet::GenerateNewKey(): Storing master key failed");
// ensure this wallet.dat can only be opened by clients supporting HD
walletInstance->SetMinVersion(FEATURE_HD);
}
CPubKey newDefaultKey;
if (walletInstance->GetKeyFromPool(newDefaultKey)) {

3
src/wallet/wallet.h

@ -78,7 +78,8 @@ enum WalletFeature @@ -78,7 +78,8 @@ enum WalletFeature
FEATURE_WALLETCRYPT = 40000, // wallet encryption
FEATURE_COMPRPUBKEY = 60000, // compressed public keys
FEATURE_LATEST = 60000
FEATURE_HD = 130000, // Hierarchical key derivation after BIP32 (HD Wallet)
FEATURE_LATEST = FEATURE_COMPRPUBKEY // HD is optional, use FEATURE_COMPRPUBKEY as latest version
};

Loading…
Cancel
Save