[Wallet] Ensure <0.13 clients can't open HD wallets

This commit is contained in:
Jonas Schnelli
2016-07-15 11:42:47 +02:00
parent 37269105c8
commit 3b38a6a96a
3 changed files with 7 additions and 1 deletions

View File

@@ -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)) {