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)
This commit is contained in:
Wladimir J. van der Laan
2016-07-19 12:14:07 +02:00
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)) {