aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-11-30 00:19:44 +0200
committerRiccardo Spagni <ric@spagni.net>2015-11-30 00:19:47 +0200
commitbc1bc4adb246b08adee2144ce2c7e3784f7899f1 (patch)
tree297f1fde9102ffe8a76f84a9e4e4bdd181224f27 /src/wallet
parentMerge pull request #506 (diff)
parentwallet: optional automatic refresh from the daemon (diff)
downloadmonero-bc1bc4adb246b08adee2144ce2c7e3784f7899f1.tar.xz
Merge pull request #507
62e49a5 wallet: optional automatic refresh from the daemon (moneromooo-monero)
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet2.cpp4
-rw-r--r--src/wallet/wallet2.h7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 6136480d6..8a172be90 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -822,6 +822,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);
@@ -906,6 +909,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();
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index b71697c1f..d6aea182d 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -87,10 +87,10 @@ namespace tools
};
private:
- wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_info(true), m_default_mixin(0), m_refresh_type(RefreshOptimizeCoinbase) {}
+ wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers (false), m_store_tx_info(true), m_default_mixin(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true) {}
public:
- wallet2(bool testnet = false, bool restricted = false) : m_run(true), m_callback(0), m_testnet(testnet), m_restricted(restricted), is_old_file_format(false), m_store_tx_info(true), m_default_mixin(0), m_refresh_type(RefreshOptimizeCoinbase) {}
+ wallet2(bool testnet = false, bool restricted = false) : m_run(true), m_callback(0), m_testnet(testnet), m_restricted(restricted), is_old_file_format(false), m_store_tx_info(true), m_default_mixin(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true) {}
struct transfer_details
{
uint64_t m_block_height;
@@ -330,6 +330,8 @@ namespace tools
void store_tx_info(bool store) { m_store_tx_info = store; }
uint32_t default_mixin() const { return m_default_mixin; }
void default_mixin(uint32_t m) { m_default_mixin = m; }
+ bool auto_refresh() const { return m_auto_refresh; }
+ void auto_refresh(bool r) { m_auto_refresh = r; }
bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key) const;
@@ -401,6 +403,7 @@ namespace tools
bool m_store_tx_info; /*!< request txkey to be returned in RPC, and store in the wallet cache file */
uint32_t m_default_mixin;
RefreshType m_refresh_type;
+ bool m_auto_refresh;
};
}
BOOST_CLASS_VERSION(tools::wallet2, 10)