mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 21:03:28 +01:00
Merge pull request #7747
8cf95c8
wallet2: refresh: check error and throw before potentially breaking out of loop (tobtoht)
This commit is contained in:
commit
9aa2d4c16e
@ -3494,14 +3494,6 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
|
|||||||
blocks_fetched += added_blocks;
|
blocks_fetched += added_blocks;
|
||||||
}
|
}
|
||||||
THROW_WALLET_EXCEPTION_IF(!waiter.wait(), error::wallet_internal_error, "Exception in thread pool");
|
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
|
// handle error from async fetching thread
|
||||||
if (error)
|
if (error)
|
||||||
@ -3512,6 +3504,15 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
|
|||||||
throw std::runtime_error("proxy exception in refresh thread");
|
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())
|
if (!next_blocks.empty())
|
||||||
{
|
{
|
||||||
const uint64_t expected_start_height = std::max(static_cast<uint64_t>(m_blockchain.size()), uint64_t(1)) - 1;
|
const uint64_t expected_start_height = std::max(static_cast<uint64_t>(m_blockchain.size()), uint64_t(1)) - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user