[Wallet] keep HD seed during salvagewallet

b993671921
This commit is contained in:
lateminer
2018-01-02 13:33:57 +03:00
parent e373a90495
commit 00cb4d52f3
2 changed files with 2 additions and 2 deletions

View File

@@ -1540,7 +1540,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
RandAddSeedPerfmon();
// Create new keyUser and set as default key
if (GetBoolArg("-usehd", true)) {
if (GetBoolArg("-usehd", true) && pwalletMain->hdChain.masterKeyID.IsNull() ) {
// generate a new master key
CKey key;
key.MakeNewKey(true);

View File

@@ -977,7 +977,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKe
fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
wss, strType, strErr);
}
if (!IsKeyType(strType))
if (!IsKeyType(strType) && strType != "hdchain")
continue;
if (!fReadOK)
{