From 00cb4d52f3726fb22a90c257d7fdb8de812c7f83 Mon Sep 17 00:00:00 2001 From: lateminer Date: Tue, 2 Jan 2018 13:33:57 +0300 Subject: [PATCH] [Wallet] keep HD seed during salvagewallet https://github.com/bitcoin/bitcoin/pull/8324/commits/b993671921c0c301f18c542e77d695fdc50ffd91 --- src/init.cpp | 2 +- src/wallet/walletdb.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 848047ef9..d7c6b66c5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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); diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 522568faf..dfe580636 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -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) {