wallet: remove CLI code for non default ring sizes
This commit is contained in:
parent
0a1eaf26f9
commit
a668312cfa
@ -6584,23 +6584,7 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri
|
|||||||
}
|
}
|
||||||
if (!process_ring_members(ptx_vector, prompt, m_wallet->print_ring_members()))
|
if (!process_ring_members(ptx_vector, prompt, m_wallet->print_ring_members()))
|
||||||
return false;
|
return false;
|
||||||
bool default_ring_size = true;
|
|
||||||
for (const auto &ptx: ptx_vector)
|
|
||||||
{
|
|
||||||
for (const auto &vin: ptx.tx.vin)
|
|
||||||
{
|
|
||||||
if (vin.type() == typeid(txin_to_key))
|
|
||||||
{
|
|
||||||
const txin_to_key& in_to_key = boost::get<txin_to_key>(vin);
|
|
||||||
if (in_to_key.key_offsets.size() != min_ring_size)
|
|
||||||
default_ring_size = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m_wallet->confirm_non_default_ring_size() && !default_ring_size)
|
|
||||||
{
|
|
||||||
prompt << tr("WARNING: this is a non default ring size, which may harm your privacy. Default is recommended.");
|
|
||||||
}
|
|
||||||
prompt << ENDL << tr("Is this okay?");
|
prompt << ENDL << tr("Is this okay?");
|
||||||
|
|
||||||
std::string accepted = input_line(prompt.str(), true);
|
std::string accepted = input_line(prompt.str(), true);
|
||||||
|
@ -1169,7 +1169,6 @@ wallet2::wallet2(network_type nettype, uint64_t kdf_rounds, bool unattended, std
|
|||||||
m_refresh_from_block_height(0),
|
m_refresh_from_block_height(0),
|
||||||
m_explicit_refresh_from_block_height(true),
|
m_explicit_refresh_from_block_height(true),
|
||||||
m_skip_to_height(0),
|
m_skip_to_height(0),
|
||||||
m_confirm_non_default_ring_size(true),
|
|
||||||
m_ask_password(AskPasswordToDecrypt),
|
m_ask_password(AskPasswordToDecrypt),
|
||||||
m_max_reorg_depth(ORPHANED_BLOCKS_MAX_COUNT),
|
m_max_reorg_depth(ORPHANED_BLOCKS_MAX_COUNT),
|
||||||
m_min_output_count(0),
|
m_min_output_count(0),
|
||||||
@ -4390,7 +4389,7 @@ boost::optional<wallet2::keys_file_data> wallet2::get_keys_file_data(const epee:
|
|||||||
value2.SetUint64(m_skip_to_height);
|
value2.SetUint64(m_skip_to_height);
|
||||||
json.AddMember("skip_to_height", value2, json.GetAllocator());
|
json.AddMember("skip_to_height", value2, json.GetAllocator());
|
||||||
|
|
||||||
value2.SetInt(m_confirm_non_default_ring_size ? 1 :0);
|
value2.SetInt(1); // exists for deserialization backwards compatibility
|
||||||
json.AddMember("confirm_non_default_ring_size", value2, json.GetAllocator());
|
json.AddMember("confirm_non_default_ring_size", value2, json.GetAllocator());
|
||||||
|
|
||||||
value2.SetInt(m_ask_password);
|
value2.SetInt(m_ask_password);
|
||||||
@ -4623,7 +4622,6 @@ bool wallet2::load_keys_buf(const std::string& keys_buf, const epee::wipeable_st
|
|||||||
m_refresh_type = RefreshType::RefreshDefault;
|
m_refresh_type = RefreshType::RefreshDefault;
|
||||||
m_refresh_from_block_height = 0;
|
m_refresh_from_block_height = 0;
|
||||||
m_skip_to_height = 0;
|
m_skip_to_height = 0;
|
||||||
m_confirm_non_default_ring_size = true;
|
|
||||||
m_ask_password = AskPasswordToDecrypt;
|
m_ask_password = AskPasswordToDecrypt;
|
||||||
cryptonote::set_default_decimal_point(CRYPTONOTE_DISPLAY_DECIMAL_POINT);
|
cryptonote::set_default_decimal_point(CRYPTONOTE_DISPLAY_DECIMAL_POINT);
|
||||||
m_max_reorg_depth = ORPHANED_BLOCKS_MAX_COUNT;
|
m_max_reorg_depth = ORPHANED_BLOCKS_MAX_COUNT;
|
||||||
@ -4775,8 +4773,6 @@ bool wallet2::load_keys_buf(const std::string& keys_buf, const epee::wipeable_st
|
|||||||
m_refresh_from_block_height = field_refresh_height;
|
m_refresh_from_block_height = field_refresh_height;
|
||||||
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, skip_to_height, uint64_t, Uint64, false, 0);
|
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, skip_to_height, uint64_t, Uint64, false, 0);
|
||||||
m_skip_to_height = field_skip_to_height;
|
m_skip_to_height = field_skip_to_height;
|
||||||
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, confirm_non_default_ring_size, int, Int, false, true);
|
|
||||||
m_confirm_non_default_ring_size = field_confirm_non_default_ring_size;
|
|
||||||
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, ask_password, AskPasswordType, Int, false, AskPasswordToDecrypt);
|
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, ask_password, AskPasswordType, Int, false, AskPasswordToDecrypt);
|
||||||
m_ask_password = field_ask_password;
|
m_ask_password = field_ask_password;
|
||||||
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, default_decimal_point, int, Int, false, CRYPTONOTE_DISPLAY_DECIMAL_POINT);
|
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, default_decimal_point, int, Int, false, CRYPTONOTE_DISPLAY_DECIMAL_POINT);
|
||||||
|
@ -1342,8 +1342,6 @@ private:
|
|||||||
void segregation_height(uint64_t height) { m_segregation_height = height; }
|
void segregation_height(uint64_t height) { m_segregation_height = height; }
|
||||||
bool ignore_fractional_outputs() const { return m_ignore_fractional_outputs; }
|
bool ignore_fractional_outputs() const { return m_ignore_fractional_outputs; }
|
||||||
void ignore_fractional_outputs(bool value) { m_ignore_fractional_outputs = value; }
|
void ignore_fractional_outputs(bool value) { m_ignore_fractional_outputs = value; }
|
||||||
bool confirm_non_default_ring_size() const { return m_confirm_non_default_ring_size; }
|
|
||||||
void confirm_non_default_ring_size(bool always) { m_confirm_non_default_ring_size = always; }
|
|
||||||
uint64_t ignore_outputs_above() const { return m_ignore_outputs_above; }
|
uint64_t ignore_outputs_above() const { return m_ignore_outputs_above; }
|
||||||
void ignore_outputs_above(uint64_t value) { m_ignore_outputs_above = value; }
|
void ignore_outputs_above(uint64_t value) { m_ignore_outputs_above = value; }
|
||||||
uint64_t ignore_outputs_below() const { return m_ignore_outputs_below; }
|
uint64_t ignore_outputs_below() const { return m_ignore_outputs_below; }
|
||||||
|
Loading…
Reference in New Issue
Block a user