aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2022-03-02 18:54:47 -0500
committerluigi1111 <luigi1111w@gmail.com>2022-03-02 18:54:47 -0500
commite77ba90daaef33bbc6821f1128c427e51d15b6ff (patch)
treeada21ac9485e9c07e603686d3924c9278cff6a9e
parentMerge pull request #8131 (diff)
parentwallet inits cache if file and blob missing (diff)
downloadmonero-e77ba90daaef33bbc6821f1128c427e51d15b6ff.tar.xz
Merge pull request #8163
34c1561 wallet inits cache if file and blob missing (woodser)
-rw-r--r--src/wallet/wallet2.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index cbdda4f72..8f8fc7160 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -5627,13 +5627,14 @@ void wallet2::load(const std::string& wallet_, const epee::wipeable_string& pass
wallet_keys_unlocker unlocker(*this, m_ask_password == AskPasswordToDecrypt && !m_unattended && !m_watch_only, password);
//keys loaded ok!
- //try to load wallet file. but even if we failed, it is not big problem
- if (use_fs && (!boost::filesystem::exists(m_wallet_file, e) || e))
+ //try to load wallet cache. but even if we failed, it is not big problem
+ bool cache_missing = use_fs ? (!boost::filesystem::exists(m_wallet_file, e) || e) : cache_buf.empty();
+ if (cache_missing)
{
- LOG_PRINT_L0("file not found: " << m_wallet_file << ", starting with empty blockchain");
+ LOG_PRINT_L0("wallet cache missing: " << m_wallet_file << ", starting with empty blockchain");
m_account_public_address = m_account.get_keys().m_account_address;
}
- else if (use_fs || !cache_buf.empty())
+ else
{
wallet2::cache_file_data cache_file_data;
std::string cache_file_buf;