aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api
diff options
context:
space:
mode:
authorJacob Brydolf <jacob@brydolf.net>2016-11-08 13:20:42 +0100
committerJacob Brydolf <jacob@brydolf.net>2016-11-08 13:20:42 +0100
commit0c530de057a2b8fa30ffb8a8f23312d9eb3b9afe (patch)
tree57e3ce3284fca60629aed3ff70e9c17c910a50a5 /src/wallet/api
parentMerge pull request #1295 (diff)
downloadmonero-0c530de057a2b8fa30ffb8a8f23312d9eb3b9afe.tar.xz
Wallet API: Pause refresh while creating transaction
Diffstat (limited to 'src/wallet/api')
-rw-r--r--src/wallet/api/wallet.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 9a9638b40..ffc507bd2 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -545,6 +545,8 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
{
clearStatus();
+ // Pause refresh thread while creating transaction
+ pauseRefresh();
vector<cryptonote::tx_destination_entry> dsts;
cryptonote::tx_destination_entry de;
@@ -678,6 +680,8 @@ PendingTransaction *WalletImpl::createTransaction(const string &dst_addr, const
transaction->m_status = m_status;
transaction->m_errorString = m_errorString;
+ // Resume refresh thread
+ startRefresh();
return transaction;
}
@@ -798,6 +802,7 @@ void WalletImpl::doRefresh()
void WalletImpl::startRefresh()
{
+ LOG_PRINT_L2(__FUNCTION__ << ": refresh started/resumed...");
if (!m_refreshEnabled) {
m_refreshEnabled = true;
m_refreshCV.notify_one();
@@ -818,6 +823,7 @@ void WalletImpl::stopRefresh()
void WalletImpl::pauseRefresh()
{
+ LOG_PRINT_L2(__FUNCTION__ << ": refresh paused...");
// TODO synchronize access
if (!m_refreshThreadDone) {
m_refreshEnabled = false;