diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-04-12 13:47:19 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-04-12 13:47:20 +0200 |
commit | 5d8439e310e1804c13dd380161494cfa46997e37 (patch) | |
tree | 1bf2c08673f06daa9e374975d3f8352f2ab6385b /src/simplewallet/simplewallet.cpp | |
parent | Merge pull request #3532 (diff) | |
parent | wallet: warn if not using the default ring size (diff) | |
download | monero-5d8439e310e1804c13dd380161494cfa46997e37.tar.xz |
Merge pull request #3534
eecfb57d wallet: warn if not using the default ring size (moneromooo-monero)
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index cd1201df7..33615ffe2 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1650,6 +1650,9 @@ bool simple_wallet::set_default_ring_size(const std::vector<std::string> &args/* return true; } + if (ring_size != 0 && ring_size != DEFAULT_MIX+1) + message_writer() << tr("WARNING: this is a non default ring size, which may harm your privacy. Default is recommended."); + const auto pwd_container = get_and_verify_password(); if (pwd_container) { @@ -4600,6 +4603,23 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector<std::stri if (!print_ring_members(ptx_vector, prompt)) return true; } + 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() != DEFAULT_MIX + 1) + 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? (Y/Yes/N/No): "); std::string accepted = input_line(prompt.str()); |