diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-03-03 14:31:04 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-03-03 14:31:04 +0200 |
commit | d35d6261810bea652e526b4c93e6dcf063c498eb (patch) | |
tree | 4dc30d32c47f6a2e7254b62a989876c839317440 /src/wallet | |
parent | Merge pull request #1823 (diff) | |
parent | allow user I/O in millinero, micronero, nanonero, piconero (diff) | |
download | monero-d35d6261810bea652e526b4c93e6dcf063c498eb.tar.xz |
Merge pull request #1826
2c468dd4 allow user I/O in millinero, micronero, nanonero, piconero (moneromooo-monero)
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet2.cpp | 15 | ||||
-rw-r--r-- | src/wallet/wallet2.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3c9d2406a..3b987c7d6 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1894,6 +1894,9 @@ bool wallet2::store_keys(const std::string& keys_file_name, const std::string& p value2.SetInt(m_ask_password ? 1 :0); json.AddMember("ask_password", value2, json.GetAllocator()); + value2.SetInt(cryptonote::get_default_decimal_point()); + json.AddMember("default_decimal_point", value2, json.GetAllocator()); + // Serialize the JSON object rapidjson::StringBuffer buffer; rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); @@ -2024,6 +2027,8 @@ bool wallet2::load_keys(const std::string& keys_file_name, const std::string& pa m_confirm_missing_payment_id = field_confirm_missing_payment_id; GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, ask_password, int, Int, false, true); m_ask_password = field_ask_password; + GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, default_decimal_point, int, Int, false, CRYPTONOTE_DISPLAY_DECIMAL_POINT); + cryptonote::set_default_decimal_point(field_default_decimal_point); } const cryptonote::account_keys& keys = m_account.get_keys(); @@ -2288,6 +2293,16 @@ bool wallet2::parse_payment_id(const std::string& payment_id_str, crypto::hash& return false; } //---------------------------------------------------------------------------------------------------- +void wallet2::set_default_decimal_point(unsigned int decimal_point) +{ + cryptonote::set_default_decimal_point(decimal_point); +} +//---------------------------------------------------------------------------------------------------- +unsigned int wallet2::get_default_decimal_point() const +{ + return cryptonote::get_default_decimal_point(); +} +//---------------------------------------------------------------------------------------------------- bool wallet2::prepare_file_names(const std::string& file_path) { do_prepare_file_names(file_path, m_keys_file, m_wallet_file); diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 67bd93a82..416b7ea69 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -510,6 +510,8 @@ namespace tools void confirm_missing_payment_id(bool always) { m_confirm_missing_payment_id = always; } bool ask_password() const { return m_ask_password; } void ask_password(bool always) { m_ask_password = always; } + void set_default_decimal_point(unsigned int decimal_point); + unsigned int get_default_decimal_point() const; bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key) const; |