aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2022-05-25 09:30:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2023-08-17 15:35:00 +0000
commit356e6877dcd3fcb337ea8ff8c88cf44fbc6a30a6 (patch)
tree3eaba537c9746333a177f85ec54201feff5d89fd /src/wallet/wallet2.cpp
parentwallet_rpc_server: add --no-initial-sync flag for quicker network binding (diff)
downloadmonero-356e6877dcd3fcb337ea8ff8c88cf44fbc6a30a6.tar.xz
wallet_rpc_server: chunk refresh to keep responding to RPC while refreshing
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 42e2f1d41..ff70f90b5 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -3901,7 +3901,7 @@ std::shared_ptr<std::map<std::pair<uint64_t, uint64_t>, 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, bool try_incremental)
+void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blocks_fetched, bool& received_money, bool check_pool, uint64_t max_blocks, bool try_incremental)
{
if (m_offline)
{
@@ -3996,7 +3996,7 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
// infer when we get an incoming output
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<cryptonote::block_complete_entry> next_blocks;