diff options
author | Jaquee <jaquee.monero@gmail.com> | 2016-12-27 19:12:18 +0100 |
---|---|---|
committer | Jaquee <jaquee.monero@gmail.com> | 2016-12-27 19:12:18 +0100 |
commit | 4585ada453a81e844594c651b5243e3c77ceb1e1 (patch) | |
tree | e38b6b3c97574ac39f43ed9498a0ad3391ba3997 /src/wallet/wallet2.cpp | |
parent | Merge pull request #1487 (diff) | |
download | monero-4585ada453a81e844594c651b5243e3c77ceb1e1.tar.xz |
Wallet2: faster exit while refreshing
Diffstat (limited to '')
-rw-r--r-- | src/wallet/wallet2.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 221dd8e0b..efb7554bb 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1613,6 +1613,9 @@ void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& re // and then fall through to regular refresh processing } + // If stop() is called during fast refresh we don't need to continue + if(!m_run.load(std::memory_order_relaxed)) + return; pull_blocks(start_height, blocks_start_height, short_chain_history, blocks, o_indices); // always reset start_height to 0 to force short_chain_ history to be used on // subsequent pulls in this refresh. @@ -1668,7 +1671,9 @@ void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& re try { - update_pool_state(); + // If stop() is called we don't need to check pending transactions + if(m_run.load(std::memory_order_relaxed)) + update_pool_state(); } catch (...) { |