aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 97dadb126..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)
{
@@ -2974,6 +2977,22 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
// create wallet
bool r = new_wallet(vm, "Ledger");
CHECK_AND_ASSERT_MES(r, false, tr("account creation failed"));
+ // if no block_height is specified, assume its a new account and start it "now"
+ if(m_wallet->get_refresh_from_block_height() == 0) {
+ {
+ tools::scoped_message_writer wrt = tools::msg_writer();
+ wrt << tr("No restore height is specified.");
+ wrt << tr("Assumed you are creating a new account, restore will be done from current estimated blockchain height.");
+ wrt << tr("Use --restore-height if you want to restore an already setup account from a specific height");
+ }
+ std::string confirm = input_line(tr("Is this okay? (Y/Yes/N/No): "));
+ if (std::cin.eof() || !command_line::is_yes(confirm))
+ CHECK_AND_ASSERT_MES(false, false, tr("account creation aborted"));
+
+ m_wallet->set_refresh_from_block_height(m_wallet->estimate_blockchain_height()-1);
+ m_wallet->explicit_refresh_from_block_height(true);
+ m_restore_height = m_wallet->get_refresh_from_block_height();
+ }
}
else
{
@@ -2990,7 +3009,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
CHECK_AND_ASSERT_MES(r, false, tr("account creation failed"));
}
- if (m_restoring && m_generate_from_json.empty())
+ if (m_restoring && m_generate_from_json.empty() && m_generate_from_device.empty())
{
m_wallet->explicit_refresh_from_block_height(!command_line::is_arg_defaulted(vm, arg_restore_height));
}
@@ -3101,6 +3120,9 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
if (!m_trusted_daemon)
message_writer() << (boost::format(tr("Warning: using an untrusted daemon at %s, privacy will be lessened")) % m_wallet->get_daemon_address()).str();
+ if (m_wallet->get_ring_database().empty())
+ fail_msg_writer() << tr("Failed to initialize ring database: privacy enhancing features will be inactive");
+
m_wallet->callback(this);
return true;
@@ -3385,7 +3407,7 @@ bool simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
try
{
m_wallet->restore(m_wallet_file, std::move(rc.second).password(), device_name);
- message_writer(console_color_white, true) << tr("Generated new on device wallet: ")
+ message_writer(console_color_white, true) << tr("Generated new wallet on hw device: ")
<< m_wallet->get_account().get_public_address_str(m_wallet->nettype());
}
catch (const std::exception& e)
@@ -4581,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());
@@ -7458,7 +7497,7 @@ int main(int argc, char* argv[])
const auto vm = wallet_args::main(
argc, argv,
"monero-wallet-cli [--wallet-file=<file>|--generate-new-wallet=<file>] [<COMMAND>]",
- sw::tr("This is the command line monero wallet. It needs to connect to a monero\ndaemon to work correctly."),
+ sw::tr("This is the command line monero wallet. It needs to connect to a monero\ndaemon to work correctly.\nWARNING: Do not reuse your Monero keys on an another fork, UNLESS this fork has key reuse mitigations built in. Doing so will harm your privacy."),
desc_params,
positional_options,
[](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; },