diff options
author | Jaquee <jaquee.monero@gmail.com> | 2016-12-14 12:18:52 +0100 |
---|---|---|
committer | Jaquee <jaquee.monero@gmail.com> | 2016-12-15 12:31:09 +0100 |
commit | 944b6079d9ab3ec35c5389f576115570f42a3f80 (patch) | |
tree | e54dff00188e533119f62aa60e3f38ad8782ccaf /src/wallet/api/wallet.h | |
parent | Merge pull request #1445 (diff) | |
download | monero-944b6079d9ab3ec35c5389f576115570f42a3f80.tar.xz |
Wallet API: Do not refresh while daemon is syncing
+ fixed fast refresh when creating wallet offline
+ improved close wallet logic (make sure refresh thread is stopped)
Diffstat (limited to 'src/wallet/api/wallet.h')
-rw-r--r-- | src/wallet/api/wallet.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index 5046fbf0f..d245a78d0 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -107,14 +107,15 @@ public: virtual std::string getTxKey(const std::string &txid) const; virtual std::string signMessage(const std::string &message); virtual bool verifySignedMessage(const std::string &message, const std::string &address, const std::string &signature) const; + virtual void startRefresh(); + virtual void pauseRefresh(); private: void clearStatus(); void refreshThreadFunc(); void doRefresh(); - void startRefresh(); + bool daemonSynced() const; void stopRefresh(); - void pauseRefresh(); bool isNewWallet() const; void doInit(const std::string &daemon_address, uint64_t upper_transaction_size_limit); @@ -148,9 +149,11 @@ private: // flag indicating wallet is recovering from seed // so it shouldn't be considered as new and pull blocks (slow-refresh) // instead of pulling hashes (fast-refresh) - bool m_recoveringFromSeed; + std::atomic<bool> m_recoveringFromSeed; std::atomic<bool> m_synchronized; - bool m_rebuildWalletCache; + std::atomic<bool> m_rebuildWalletCache; + // cache connection status to avoid unnecessary RPC calls + mutable std::atomic<bool> m_is_connected; }; |