Skip to content

Commit

Permalink
wallet: Skip loading on start of wallets with encrypted databases
Browse files Browse the repository at this point in the history
Wallets with encrypted databases need the user to provide their database
passphrase which cannot be done on start, so skip any such wallets on
startup.
  • Loading branch information
achow101 committed Sep 14, 2023
1 parent f75430c commit bb4ac74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wallet/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ bool VerifyWallets(WalletContext& context)
if (!MakeWalletDatabase(wallet_file, options, status, error_string)) {
if (status == DatabaseStatus::FAILED_NOT_FOUND) {
chain.initWarning(Untranslated(strprintf("Skipping -wallet path that doesn't exist. %s", error_string.original)));
} else if (status == DatabaseStatus::FAILED_ENCRYPT) {
chain.initWarning(Untranslated(strprintf("Skipping -wallet path to encrypted wallet, use loadwallet to load it. %s", error_string.original)));
} else {
chain.initError(error_string);
return false;
Expand Down Expand Up @@ -120,7 +122,7 @@ bool LoadWallets(WalletContext& context)
bilingual_str error;
std::vector<bilingual_str> warnings;
std::unique_ptr<WalletDatabase> database = MakeWalletDatabase(name, options, status, error);
if (!database && status == DatabaseStatus::FAILED_NOT_FOUND) {
if (!database && (status == DatabaseStatus::FAILED_NOT_FOUND || status == DatabaseStatus::FAILED_ENCRYPT)) {
continue;
}
chain.initMessage(_("Loading wallet…").translated);
Expand Down

0 comments on commit bb4ac74

Please sign in to comment.