mirror of
https://github.com/monero-project/monero.git
synced 2024-11-17 08:17:37 +00:00
wallet2: don't delete file that may not exist
This commit is contained in:
parent
b8643752c1
commit
4d22317dee
1 changed files with 5 additions and 5 deletions
|
@ -5570,6 +5570,11 @@ void wallet2::store_to(const std::string &path, const epee::wipeable_string &pas
|
||||||
const std::string address_file = m_wallet_file + ".address.txt";
|
const std::string address_file = m_wallet_file + ".address.txt";
|
||||||
r = save_to_file(address_file, m_account.get_public_address_str(m_nettype), true);
|
r = save_to_file(address_file, m_account.get_public_address_str(m_nettype), true);
|
||||||
THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, m_wallet_file);
|
THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, m_wallet_file);
|
||||||
|
// remove old address file
|
||||||
|
r = boost::filesystem::remove(old_address_file);
|
||||||
|
if (!r) {
|
||||||
|
LOG_ERROR("error removing file: " << old_address_file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// remove old wallet file
|
// remove old wallet file
|
||||||
r = boost::filesystem::remove(old_file);
|
r = boost::filesystem::remove(old_file);
|
||||||
|
@ -5581,11 +5586,6 @@ void wallet2::store_to(const std::string &path, const epee::wipeable_string &pas
|
||||||
if (!r) {
|
if (!r) {
|
||||||
LOG_ERROR("error removing file: " << old_keys_file);
|
LOG_ERROR("error removing file: " << old_keys_file);
|
||||||
}
|
}
|
||||||
// remove old address file
|
|
||||||
r = boost::filesystem::remove(old_address_file);
|
|
||||||
if (!r) {
|
|
||||||
LOG_ERROR("error removing file: " << old_address_file);
|
|
||||||
}
|
|
||||||
// remove old message store file
|
// remove old message store file
|
||||||
if (boost::filesystem::exists(old_mms_file))
|
if (boost::filesystem::exists(old_mms_file))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue