From 62e49a5f02da0963fb0303383626b2c86443d405 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 28 Nov 2015 12:38:58 +0000 Subject: 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. --- src/simplewallet/simplewallet.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/simplewallet/simplewallet.h') 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 &args = std::vector()); bool set_store_tx_info(const std::vector &args = std::vector()); bool set_default_mixin(const std::vector &args = std::vector()); + bool set_auto_refresh(const std::vector &args = std::vector()); bool help(const std::vector &args = std::vector()); bool start_mining(const std::vector &args); bool stop_mining(const std::vector &args); @@ -229,5 +232,11 @@ namespace cryptonote std::unique_ptr m_wallet; epee::net_utils::http::http_simple_client m_http_client; refresh_progress_reporter_t m_refresh_progress_reporter; + + std::atomic 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; }; } -- cgit v1.2.3