[Wallet] keep HD seed during salvagewallet

pull/262/head
Jonas Schnelli 8 years ago
parent 67caef6730
commit b993671921
No known key found for this signature in database
GPG Key ID: 29D4BCB6416F53EC

@ -3291,7 +3291,7 @@ bool CWallet::InitLoadWallet()
if (fFirstRun)
{
// Create new keyUser and set as default key
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET)) {
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && walletInstance->hdChain.masterKeyID.IsNull()) {
// generate a new master key
CKey key;
key.MakeNewKey(true);

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

Loading…
Cancel
Save