diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-03-14 13:35:11 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-03-14 13:35:11 +0200 |
commit | 3fed7886038ee8f4d227cc5ce9503cea769cd27e (patch) | |
tree | 243bd490eaac422c483cb0a8e1791f13ea007efc /src/simplewallet | |
parent | Merge pull request #3368 (diff) | |
parent | wallet2 / simplewallet: Must opt-in to create '.address.txt' files for new wa... (diff) | |
download | monero-3fed7886038ee8f4d227cc5ce9503cea769cd27e.tar.xz |
Merge pull request #3315
649a1b7a wallet2 / simplewallet: Must opt-in to create '.address.txt' files for new wallets (Leon Klingele)
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index cbb174e1a..3a81e89ed 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -134,6 +134,7 @@ namespace const command_line::arg_descriptor<bool> arg_allow_mismatched_daemon_version = {"allow-mismatched-daemon-version", sw::tr("Allow communicating with a daemon that uses a different RPC version"), false}; const command_line::arg_descriptor<uint64_t> arg_restore_height = {"restore-height", sw::tr("Restore from specific blockchain height"), 0}; const command_line::arg_descriptor<bool> arg_do_not_relay = {"do-not-relay", sw::tr("The newly created transaction will not be relayed to the monero network"), false}; + const command_line::arg_descriptor<bool> arg_create_address_file = {"create-address-file", sw::tr("Create an address file for new wallets"), false}; const command_line::arg_descriptor< std::vector<std::string> > arg_command = {"command", ""}; @@ -2848,10 +2849,12 @@ bool simple_wallet::new_wallet(const boost::program_options::variables_map& vm, m_wallet->set_seed_language(mnemonic_language); + bool create_address_file = command_line::get_arg(vm, arg_create_address_file); + crypto::secret_key recovery_val; try { - recovery_val = m_wallet->generate(m_wallet_file, std::move(rc.second).password(), recovery_key, recover, two_random); + recovery_val = m_wallet->generate(m_wallet_file, std::move(rc.second).password(), recovery_key, recover, two_random, create_address_file); message_writer(console_color_white, true) << tr("Generated new wallet: ") << m_wallet->get_account().get_public_address_str(m_wallet->nettype()); std::cout << tr("View key: ") << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << ENDL; @@ -2900,15 +2903,17 @@ bool simple_wallet::new_wallet(const boost::program_options::variables_map& vm, if (m_restore_height) m_wallet->set_refresh_from_block_height(m_restore_height); + bool create_address_file = command_line::get_arg(vm, arg_create_address_file); + try { if (spendkey) { - m_wallet->generate(m_wallet_file, std::move(rc.second).password(), address, *spendkey, viewkey); + m_wallet->generate(m_wallet_file, std::move(rc.second).password(), address, *spendkey, viewkey, create_address_file); } else { - m_wallet->generate(m_wallet_file, std::move(rc.second).password(), address, viewkey); + m_wallet->generate(m_wallet_file, std::move(rc.second).password(), address, viewkey, create_address_file); } message_writer(console_color_white, true) << tr("Generated new wallet: ") << m_wallet->get_account().get_public_address_str(m_wallet->nettype()); @@ -2971,9 +2976,11 @@ bool simple_wallet::new_wallet(const boost::program_options::variables_map& vm, m_wallet->set_seed_language(mnemonic_language); + bool create_address_file = command_line::get_arg(vm, arg_create_address_file); + try { - m_wallet->generate(m_wallet_file, std::move(rc.second).password(), multisig_keys); + m_wallet->generate(m_wallet_file, std::move(rc.second).password(), multisig_keys, create_address_file); bool ready; uint32_t threshold, total; if (!m_wallet->multisig(&ready, &threshold, &total) || !ready) @@ -6979,6 +6986,7 @@ int main(int argc, char* argv[]) command_line::add_arg(desc_params, arg_allow_mismatched_daemon_version); command_line::add_arg(desc_params, arg_restore_height); command_line::add_arg(desc_params, arg_do_not_relay); + command_line::add_arg(desc_params, arg_create_address_file); po::positional_options_description positional_options; positional_options.add(arg_command.name, -1); |