aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index cb6dfd7d3..3d1cfddd0 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1320,6 +1320,9 @@ bool wallet2::set_daemon(std::string daemon_address, boost::optional<epee::net_u
m_trusted_daemon = trusted_daemon;
if (changed)
{
+ if (!m_persistent_rpc_client_id) {
+ set_rpc_client_secret_key(rct::rct2sk(rct::skGen()));
+ }
m_rpc_payment_state.expected_spent = 0;
m_rpc_payment_state.discrepancy = 0;
m_node_rpc_proxy.invalidate();
@@ -3490,14 +3493,6 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
blocks_fetched += added_blocks;
}
THROW_WALLET_EXCEPTION_IF(!waiter.wait(), error::wallet_internal_error, "Exception in thread pool");
- if(!first && blocks_start_height == next_blocks_start_height)
- {
- m_node_rpc_proxy.set_height(m_blockchain.size());
- refreshed = true;
- break;
- }
-
- first = false;
// handle error from async fetching thread
if (error)
@@ -3508,6 +3503,15 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
throw std::runtime_error("proxy exception in refresh thread");
}
+ if(!first && blocks_start_height == next_blocks_start_height)
+ {
+ m_node_rpc_proxy.set_height(m_blockchain.size());
+ refreshed = true;
+ break;
+ }
+
+ first = false;
+
if (!next_blocks.empty())
{
const uint64_t expected_start_height = std::max(static_cast<uint64_t>(m_blockchain.size()), uint64_t(1)) - 1;