mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
Merge pull request #584
5c67c48
wallet: don't forget to close the file after storing cache (moneromooo-monero)
This commit is contained in:
commit
ac7d27d4f9
@ -1305,9 +1305,11 @@ void wallet2::store()
|
|||||||
const std::string old_file = m_wallet_file + ".old";
|
const std::string old_file = m_wallet_file + ".old";
|
||||||
|
|
||||||
// save to new file
|
// save to new file
|
||||||
std::ofstream ostr(new_file);
|
std::ofstream ostr;
|
||||||
|
ostr.open(new_file, std::ios_base::binary | std::ios_base::out | std::ios_base::trunc);
|
||||||
binary_archive<true> oar(ostr);
|
binary_archive<true> oar(ostr);
|
||||||
bool success = ::serialization::serialize(oar, cache_file_data);
|
bool success = ::serialization::serialize(oar, cache_file_data);
|
||||||
|
ostr.close();
|
||||||
THROW_WALLET_EXCEPTION_IF(!success || !ostr.good(), error::file_save_error, new_file);
|
THROW_WALLET_EXCEPTION_IF(!success || !ostr.good(), error::file_save_error, new_file);
|
||||||
|
|
||||||
// rename
|
// rename
|
||||||
|
Loading…
Reference in New Issue
Block a user