aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-04-12 15:27:49 +0200
committerRiccardo Spagni <ric@spagni.net>2018-04-12 15:27:49 +0200
commit6f6521ad7a9832788e07f7f7d181ba29b010e311 (patch)
treeef5cc001330b9ddc60d0bb19dd35c4507e641d1e
parentMerge pull request #3618 (diff)
parentwallet2: store subaddress lookahead settings (diff)
downloadmonero-6f6521ad7a9832788e07f7f7d181ba29b010e311.tar.xz
Merge pull request #3606
b5d6c723 wallet2: store subaddress lookahead settings (stoffu)
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 490c05ad3..3883de6d9 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2628,6 +2628,12 @@ bool wallet2::store_keys(const std::string& keys_file_name, const epee::wipeable
value2.SetUint(m_segregation_height);
json.AddMember("segregation_height", value2, json.GetAllocator());
+ value2.SetUint(m_subaddress_lookahead_major);
+ json.AddMember("subaddress_lookahead_major", value2, json.GetAllocator());
+
+ value2.SetUint(m_subaddress_lookahead_minor);
+ json.AddMember("subaddress_lookahead_minor", value2, json.GetAllocator());
+
// Serialize the JSON object
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
@@ -2702,6 +2708,8 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_
m_segregate_pre_fork_outputs = true;
m_key_reuse_mitigation2 = true;
m_segregation_height = 0;
+ m_subaddress_lookahead_major = SUBADDRESS_LOOKAHEAD_MAJOR;
+ m_subaddress_lookahead_minor = SUBADDRESS_LOOKAHEAD_MINOR;
m_key_on_device = false;
}
else if(json.IsObject())
@@ -2826,6 +2834,10 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_
m_key_reuse_mitigation2 = field_key_reuse_mitigation2;
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, segregation_height, int, Uint, false, 0);
m_segregation_height = field_segregation_height;
+ GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, subaddress_lookahead_major, uint32_t, Uint, false, SUBADDRESS_LOOKAHEAD_MAJOR);
+ m_subaddress_lookahead_major = field_subaddress_lookahead_major;
+ GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, subaddress_lookahead_minor, uint32_t, Uint, false, SUBADDRESS_LOOKAHEAD_MINOR);
+ m_subaddress_lookahead_minor = field_subaddress_lookahead_minor;
}
else
{