diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-12-17 22:31:49 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-12-17 22:32:54 +0000 |
commit | 9b4f8b4b7ed6a22b9fa6a3b1d10210d21084cb5b (patch) | |
tree | 2e444bdab256379ef0852ba4d02ac8c7922d6272 /src/wallet/wallet_errors.h | |
parent | Merge pull request #540 (diff) | |
download | monero-9b4f8b4b7ed6a22b9fa6a3b1d10210d21084cb5b.tar.xz |
wallet: save to a temporary file, then rename
This should avoid most of wallet cache corruption cases
Diffstat (limited to 'src/wallet/wallet_errors.h')
-rw-r--r-- | src/wallet/wallet_errors.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h index 94518e691..dd13343ed 100644 --- a/src/wallet/wallet_errors.h +++ b/src/wallet/wallet_errors.h @@ -192,6 +192,12 @@ namespace tools { } + explicit file_error_base(std::string&& loc, const std::string& file, const std::error_code &e) + : wallet_logic_error(std::move(loc), std::string(file_error_messages[msg_index]) + " \"" + file + "\": " + e.message()) + , m_file(file) + { + } + const std::string& file() const { return m_file; } std::string to_string() const { return wallet_logic_error::to_string(); } |