Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5037,7 +5037,9 @@ bool CWallet::Verify(interfaces::Chain& chain, const WalletLocation& location, b
std::unique_ptr<WalletDatabase> database = CreateWalletDatabase(wallet_path);

try {
return database->Verify(error_string);
if (!database->Verify(error_string)) {
return false;
}
} catch (const fs::filesystem_error& e) {
error_string = Untranslated(strprintf("Error loading wallet %s. %s", location.GetName(), fsbridge::get_filesystem_error_message(e)));
return false;
Expand Down Expand Up @@ -5074,7 +5076,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,

int64_t nStart = GetTimeMillis();
bool fFirstRun = true;
bool fBackupCreated = false;
// TODO: Can't use std::make_shared because we need a custom deleter but
// should be possible to use std::allocate_shared.
std::shared_ptr<CWallet> walletInstance(new CWallet(chain, location, CreateWalletDatabase(location.GetPath())), ReleaseWallet);
Expand Down Expand Up @@ -5191,8 +5192,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
if (!strBackupError.original.empty()) {
return unload_wallet(strBackupError);
}
} else {
fBackupCreated = true;
}
} else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) {
// Make it impossible to disable private keys after creation
Expand Down Expand Up @@ -5410,16 +5409,6 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
walletInstance->WalletLogPrintf("nTimeFirstKey = %u\n", walletInstance->nTimeFirstKey);
}

if (!fBackupCreated) {
// Try to create wallet backup after a wallet was loaded
bilingual_str strBackupError;
if (!walletInstance->AutoBackupWallet("", strBackupError, warnings)) {
if (!strBackupError.original.empty()) {
return unload_wallet(strBackupError);
}
}
}

return walletInstance;
}

Expand Down