wallet: Catch filesystem_error and raise InitError

This commit is contained in:
MarcoFalke 2018-08-04 12:14:28 -04:00
parent 1ef57a96b8
commit fa8527ffec
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548
1 changed files with 6 additions and 1 deletions

View File

@ -3972,7 +3972,12 @@ bool CWallet::Verify(std::string wallet_file, bool salvage_wallet, std::string&
}
}
if (!WalletBatch::VerifyEnvironment(wallet_path, error_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;
}