aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-28 12:38:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-28 12:41:06 +0000
commit62e49a5f02da0963fb0303383626b2c86443d405 (patch)
treef98be933b63426d26cd3b91be7cc0db8106467d5 /src/wallet/wallet2.cpp
parentMerge pull request #501 (diff)
downloadmonero-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/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index a6ac860c7..a5a1e5977 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -744,6 +744,9 @@ bool wallet2::store_keys(const std::string& keys_file_name, const std::string& p
value2.SetUint(m_default_mixin);
json.AddMember("default_mixin", value2, json.GetAllocator());
+ value2.SetInt(m_auto_refresh ? 1 :0);
+ json.AddMember("auto_refresh", value2, json.GetAllocator());
+
// Serialize the JSON object
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
@@ -828,6 +831,7 @@ void wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
m_store_tx_info = (json.HasMember("store_tx_keys") && (json["store_tx_keys"].GetInt() != 0))
|| (json.HasMember("store_tx_info") && (json["store_tx_info"].GetInt() != 0));
m_default_mixin = json.HasMember("default_mixin") ? json["default_mixin"].GetUint() : 0;
+ m_auto_refresh = json.HasMember("auto_refresh") && (json["auto_refresh"].GetInt() != 0);
}
const cryptonote::account_keys& keys = m_account.get_keys();