From 23fde151ee0d27a48f350f67893d548c21f82583 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 25 May 2022 09:30:58 +0000 Subject: wallet_rpc_server: chunk refresh to keep responding to RPC while refreshing --- src/wallet/wallet2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wallet/wallet2.cpp') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 1eeb893c0..9efbcfac6 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3360,7 +3360,7 @@ std::shared_ptr, size_t>> wallet2::create return cache; } //---------------------------------------------------------------------------------------------------- -void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched, bool& received_money, bool check_pool) +void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched, bool& received_money, bool check_pool, uint64_t max_blocks) { if (m_offline) { @@ -3452,7 +3452,7 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo update_pool_state(process_pool_txs, true); bool first = true, last = false; - while(m_run.load(std::memory_order_relaxed)) + while(m_run.load(std::memory_order_relaxed) && blocks_fetched < max_blocks) { uint64_t next_blocks_start_height; std::vector next_blocks; -- cgit v1.2.3