aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-08 16:39:07 -0800
committerRiccardo Spagni <ric@spagni.net>2017-01-08 16:39:07 -0800
commit13c5da2aa3c1edd0264003c66dc1e2e31a454e9a (patch)
treebcb31f55c41cdcd6b09ca4734538a7418476891b /src
parentMerge pull request #1504 (diff)
parentWallet2: faster exit while refreshing (diff)
downloadmonero-13c5da2aa3c1edd0264003c66dc1e2e31a454e9a.tar.xz
Merge pull request #1508
4585ada4 Wallet2: faster exit while refreshing (Jaquee)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index f2f741f02..845b3d8c6 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1612,6 +1612,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.
@@ -1667,7 +1670,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 (...)
{