diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-11-08 22:57:03 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-11-08 22:57:04 +0200 |
commit | e8a55db29dc5e650e017037a7c4c215aba8ccd76 (patch) | |
tree | 3b9f3b92eeccc2a0955ad4314d136fb604a91061 /src/wallet/api | |
parent | Merge pull request #1306 (diff) | |
parent | Wallet API: Pause refresh while creating transaction (diff) | |
download | monero-e8a55db29dc5e650e017037a7c4c215aba8ccd76.tar.xz |
Merge pull request #1308
0c530de Wallet API: Pause refresh while creating transaction (Jacob Brydolf)
Diffstat (limited to '')
-rw-r--r-- | src/wallet/api/wallet.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index fb56a347f..3768a7998 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; } @@ -844,6 +848,7 @@ void WalletImpl::doRefresh() void WalletImpl::startRefresh() { + LOG_PRINT_L2(__FUNCTION__ << ": refresh started/resumed..."); if (!m_refreshEnabled) { m_refreshEnabled = true; m_refreshCV.notify_one(); @@ -864,6 +869,7 @@ void WalletImpl::stopRefresh() void WalletImpl::pauseRefresh() { + LOG_PRINT_L2(__FUNCTION__ << ": refresh paused..."); // TODO synchronize access if (!m_refreshThreadDone) { m_refreshEnabled = false; |