[0.13] Create a new HD seed after encrypting the wallet

https://github.com/bitcoin/bitcoin/pull/8389/commits
This commit is contained in:
lateminer
2018-01-02 13:57:39 +03:00
parent 00cb4d52f3
commit 0e02c74800
5 changed files with 55 additions and 12 deletions

View File

@@ -1543,8 +1543,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (GetBoolArg("-usehd", true) && pwalletMain->hdChain.masterKeyID.IsNull() ) {
// generate a new master key
CKey key;
key.MakeNewKey(true);
if (!pwalletMain->SetHDMasterKey(key))
CPubKey masterPubKey = pwalletMain->GenerateNewHDMasterKey();
if (!pwalletMain->SetHDMasterKey(masterPubKey))
throw std::runtime_error("CWallet::GenerateNewKey(): Storing master key failed");
}
CPubKey newDefaultKey;