simplewallet: do not suggest removing cache if the password was wrong

This commit is contained in:
moneromooo-monero 2016-08-16 23:15:35 +01:00
parent 63ba2447e2
commit e596e25367
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -1701,6 +1701,8 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
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();
// only suggest removing cache if the password was actually correct
if (m_wallet->verify_password(password))
fail_msg_writer() << boost::format(tr("You may want to remove the file \"%s\" and try again")) % wallet_file; fail_msg_writer() << boost::format(tr("You may want to remove the file \"%s\" and try again")) % wallet_file;
return false; return false;
} }