Merge #13876: wallet: Catch filesystem_error and raise InitError

fa8527ffec wallet: Catch filesystem_error and raise InitError (MarcoFalke)

Pull request description:

  Fixes #13754 by restoring the previous behaviour

Tree-SHA512: f64052e89f6b332be395df2a5ea6f227c213fa2f38e415e83f30a4fad0938e947e5cddff7902368a43c07be135955a31b90f7eac5a46875c58d54ea95f87f6e6
This commit is contained in:
MarcoFalke 2018-08-09 08:03:17 -04:00 committed by pasta
parent a9ba11c343
commit b08e60e529

View File

@ -5000,9 +5000,14 @@ bool CWallet::Verify(std::string wallet_file, bool salvage_wallet, std::string&
}
}
try {
if (!WalletBatch::VerifyEnvironment(wallet_path, error_string)) {
return false;
}
} catch (const fs::filesystem_error& e) {
error_string = strprintf("Error loading wallet %s. %s", wallet_file, e.what());
return false;
}
std::unique_ptr<CWallet> tempWallet = MakeUnique<CWallet>(wallet_file, WalletDatabase::Create(wallet_path));
if (!tempWallet->AutoBackupWallet(wallet_path, warning_string, error_string) && !error_string.empty()) {