aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wallet/node_rpc_proxy.cpp7
-rw-r--r--src/wallet/wallet2.cpp9
2 files changed, 11 insertions, 5 deletions
diff --git a/src/wallet/node_rpc_proxy.cpp b/src/wallet/node_rpc_proxy.cpp
index a576c267c..148f957eb 100644
--- a/src/wallet/node_rpc_proxy.cpp
+++ b/src/wallet/node_rpc_proxy.cpp
@@ -306,7 +306,12 @@ boost::optional<std::string> NodeRPCProxy::get_rpc_payment_info(bool mining, boo
m_rpc_payment_seed_height = resp_t.seed_height;
m_rpc_payment_cookie = resp_t.cookie;
- if (!epee::string_tools::parse_hexstr_to_binbuff(resp_t.hashing_blob, m_rpc_payment_blob) || m_rpc_payment_blob.size() < 43)
+ if (m_rpc_payment_diff == 0)
+ {
+ // If no payment required daemon doesn't give us back a hashing blob
+ m_rpc_payment_blob.clear();
+ }
+ else if (!epee::string_tools::parse_hexstr_to_binbuff(resp_t.hashing_blob, m_rpc_payment_blob) || m_rpc_payment_blob.size() < 43)
{
MERROR("Invalid hashing blob: " << resp_t.hashing_blob);
return std::string("Invalid hashing blob");
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index bdac3109f..f36fa73e0 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -5709,13 +5709,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;