diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-28 12:38:58 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-28 12:41:06 +0000 |
commit | 62e49a5f02da0963fb0303383626b2c86443d405 (patch) | |
tree | f98be933b63426d26cd3b91be7cc0db8106467d5 /src/simplewallet/simplewallet.h | |
parent | Merge pull request #501 (diff) | |
download | monero-62e49a5f02da0963fb0303383626b2c86443d405.tar.xz |
wallet: optional automatic refresh from the daemon
The daemon will be polled every 90 seconds for new blocks.
It is enabled by default, and can be turned on/off with
set auto-refresh 1 and set auto-refresh 0 in the wallet.
Diffstat (limited to 'src/simplewallet/simplewallet.h')
-rw-r--r-- | src/simplewallet/simplewallet.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index 2ad54d4ca..be510ffb2 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -77,6 +77,8 @@ namespace cryptonote bool run_console_handler(); + void wallet_refresh_thread(); + bool new_wallet(const std::string &wallet_file, const std::string& password, const crypto::secret_key& recovery_key, bool recover, bool two_random, bool testnet, const std::string &old_language); bool new_wallet(const std::string &wallet_file, const std::string& password, const cryptonote::account_public_address& address, @@ -101,6 +103,7 @@ namespace cryptonote bool set_always_confirm_transfers(const std::vector<std::string> &args = std::vector<std::string>()); bool set_store_tx_info(const std::vector<std::string> &args = std::vector<std::string>()); bool set_default_mixin(const std::vector<std::string> &args = std::vector<std::string>()); + bool set_auto_refresh(const std::vector<std::string> &args = std::vector<std::string>()); bool help(const std::vector<std::string> &args = std::vector<std::string>()); bool start_mining(const std::vector<std::string> &args); bool stop_mining(const std::vector<std::string> &args); @@ -229,5 +232,11 @@ namespace cryptonote std::unique_ptr<tools::wallet2> m_wallet; epee::net_utils::http::http_simple_client m_http_client; refresh_progress_reporter_t m_refresh_progress_reporter; + + std::atomic<bool> m_auto_refresh_run; + bool m_auto_refresh_refreshing; + std::thread m_auto_refresh_thread; + std::mutex m_auto_refresh_mutex; + std::condition_variable m_auto_refresh_cond; }; } |