mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
fix for 'failed to generate new wallet: failed to save file' error during wallet generation
This commit is contained in:
parent
e285820dfb
commit
a004130a04
1 changed files with 5 additions and 3 deletions
|
@ -1293,9 +1293,11 @@ void wallet2::store()
|
||||||
r = epee::file_io_utils::save_string_to_file(new_file, buf);
|
r = epee::file_io_utils::save_string_to_file(new_file, buf);
|
||||||
THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, new_file);
|
THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, new_file);
|
||||||
boost::filesystem::remove(old_file); // probably does not exist
|
boost::filesystem::remove(old_file); // probably does not exist
|
||||||
std::error_code e = tools::replace_file(m_wallet_file, old_file);
|
if (boost::filesystem::exists(m_wallet_file)) {
|
||||||
THROW_WALLET_EXCEPTION_IF(e, error::file_save_error, m_wallet_file, e);
|
std::error_code e = tools::replace_file(m_wallet_file, old_file);
|
||||||
e = tools::replace_file(new_file, m_wallet_file);
|
THROW_WALLET_EXCEPTION_IF(e, error::file_save_error, m_wallet_file, e);
|
||||||
|
}
|
||||||
|
std::error_code e = tools::replace_file(new_file, m_wallet_file
|
||||||
THROW_WALLET_EXCEPTION_IF(e, error::file_save_error, m_wallet_file, e);
|
THROW_WALLET_EXCEPTION_IF(e, error::file_save_error, m_wallet_file, e);
|
||||||
boost::filesystem::remove(old_file);
|
boost::filesystem::remove(old_file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue