Permalink
Browse files

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

a4f137f [Wallet] Ensure <0.13 clients can't open HD wallets (Jonas Schnelli)
  • Loading branch information...
laanwj committed Jul 19, 2016
2 parents ca7550e + a4f137f commit 045106b4f13c1d6f3a4f65d6dddc6ac1e15003bb
Showing with 5 additions and 1 deletion.
  1. +3 −0 src/wallet/wallet.cpp
  2. +2 −1 src/wallet/wallet.h
@@ -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)) {
@@ -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
};

0 comments on commit 045106b

Please sign in to comment.