Skip to content

Commit cda12bd

Browse files
committed
suggestions
1 parent cf03c33 commit cda12bd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/wallet/wallet.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, interfaces::Coin
298298
return nullptr;
299299
}
300300
if (gArgs.GetBoolArg("-usehd", DEFAULT_USE_HD_WALLET)) {
301-
LogPrintf("set HD by default\n");
301+
wallet->WalletLogPrintf("Set HD by default\n");
302302
wallet->SetMinVersion(FEATURE_HD);
303303
}
304304

@@ -310,13 +310,6 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, interfaces::Coin
310310
return nullptr;
311311
}
312312
if (!create_blank) {
313-
// Unlock the wallet
314-
if (!wallet->Unlock(passphrase)) {
315-
error = Untranslated("Error: Wallet was encrypted but could not be unlocked");
316-
status = DatabaseStatus::FAILED_ENCRYPT;
317-
return nullptr;
318-
}
319-
320313
{
321314
// TODO: drop this condition after removing option to create non-HD wallets
322315
// related backport bitcoin#11250
@@ -329,6 +322,13 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, interfaces::Coin
329322
}
330323
}
331324

325+
// Unlock the wallet
326+
if (!wallet->Unlock(passphrase)) {
327+
error = Untranslated("Error: Wallet was encrypted but could not be unlocked");
328+
status = DatabaseStatus::FAILED_ENCRYPT;
329+
return nullptr;
330+
}
331+
332332
// backup the wallet we just encrypted
333333
if (!wallet->AutoBackupWallet("", error, warnings) && !error.original.empty()) {
334334
status = DatabaseStatus::FAILED_ENCRYPT;

0 commit comments

Comments
 (0)