mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 01:12:39 +00:00
simplewallet: guard against I/O exceptions
CID 175308
This commit is contained in:
parent
06c1e05735
commit
4230876b31
1 changed files with 12 additions and 3 deletions
|
@ -1708,9 +1708,18 @@ bool simple_wallet::open_wallet(const boost::program_options::variables_map& vm)
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
fail_msg_writer() << tr("failed to load wallet: ") << e.what();
|
fail_msg_writer() << tr("failed to load wallet: ") << e.what();
|
||||||
|
if (m_wallet)
|
||||||
|
{
|
||||||
// only suggest removing cache if the password was actually correct
|
// only suggest removing cache if the password was actually correct
|
||||||
if (m_wallet && m_wallet->verify_password(password))
|
bool password_is_correct = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
password_is_correct = m_wallet->verify_password(password);
|
||||||
|
}
|
||||||
|
catch (...) { } // guard against I/O errors
|
||||||
|
if (password_is_correct)
|
||||||
fail_msg_writer() << boost::format(tr("You may want to remove the file \"%s\" and try again")) % m_wallet_file;
|
fail_msg_writer() << boost::format(tr("You may want to remove the file \"%s\" and try again")) % m_wallet_file;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
success_msg_writer() <<
|
success_msg_writer() <<
|
||||||
|
|
Loading…
Reference in a new issue