File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments