mirror of
https://github.com/monero-project/monero.git
synced 2025-08-23 11:25:08 -04:00
wallet_rpc_server: chunk refresh to keep responding to RPC while refreshing
This commit is contained in:
parent
5bb2369b55
commit
23fde151ee
3 changed files with 11 additions and 5 deletions
|
@ -3360,7 +3360,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)
|
||||
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<cryptonote::block_complete_entry> next_blocks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue