aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-01 22:27:27 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-03-02 19:02:41 +0000
commit2c468dd42989d429ae2ebcd696332a4092b4b4cc (patch)
treefd06417f46dd092d1a892093a5b46126d58e1b43 /src/wallet
parentMerge pull request #1798 (diff)
downloadmonero-2c468dd42989d429ae2ebcd696332a4092b4b4cc.tar.xz
allow user I/O in millinero, micronero, nanonero, piconero
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet2.cpp15
-rw-r--r--src/wallet/wallet2.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 7b42458c0..7b57f9009 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1880,6 +1880,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);
@@ -2010,6 +2013,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();
@@ -2274,6 +2279,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 701a0e0b7..81ce7c222 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;