Skip to content

Commit bc94b87

Browse files
committed
Merge #8324: [Wallet] keep HD seed during salvagewallet
b993671 [Wallet] keep HD seed during salvagewallet (Jonas Schnelli)
2 parents af9b7a9 + b993671 commit bc94b87

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3291,7 +3291,7 @@ bool CWallet::InitLoadWallet()
32913291
if (fFirstRun)
32923292
{
32933293
// Create new keyUser and set as default key
3294-
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET)) {
3294+
if (GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET) && walletInstance->hdChain.masterKeyID.IsNull()) {
32953295
// generate a new master key
32963296
CKey key;
32973297
key.MakeNewKey(true);

src/wallet/walletdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKe
977977
fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
978978
wss, strType, strErr);
979979
}
980-
if (!IsKeyType(strType))
980+
if (!IsKeyType(strType) && strType != "hdchain")
981981
continue;
982982
if (!fReadOK)
983983
{

0 commit comments

Comments
 (0)