From 4f279b1c7d119da512f70d362494a4b3bca6280b Mon Sep 17 00:00:00 2001 From: wowario Date: Sat, 19 Jun 2021 09:48:51 +0300 Subject: [PATCH] remove export_key command --- src/simplewallet/simplewallet.cpp | 22 ---------------------- src/simplewallet/simplewallet.h | 1 - 2 files changed, 23 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index d343b4340..0a737ec7e 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3300,9 +3300,6 @@ simple_wallet::simple_wallet() boost::bind(&simple_wallet::on_command, this, &simple_wallet::start_mining, _1), tr(USAGE_START_MINING), tr("Start mining in the daemon (bg_mining and ignore_battery are optional booleans).")); - m_cmd_binder.set_handler("export_key", - boost::bind(&simple_wallet::on_command, this, &simple_wallet::export_key, _1), - tr("Export secret spend key used for mining.")); m_cmd_binder.set_handler("stop_mining", boost::bind(&simple_wallet::on_command, this, &simple_wallet::stop_mining, _1), tr("Stop mining in the daemon.")); @@ -5522,25 +5519,6 @@ bool simple_wallet::start_mining(const std::vector& args) return true; } //---------------------------------------------------------------------------------------------------- -bool simple_wallet::export_key(const std::vector& args) -{ - const auto pwd_container = get_and_verify_password(); - if (pwd_container) - { - crypto::secret_key skey; - skey = m_wallet->get_account().get_keys().m_spend_secret_key; - std::string skey_str; - skey_str = epee::string_tools::pod_to_hex(skey); - std::ofstream key_file; - key_file.open("spend.key"); - key_file << skey_str; - key_file.close(); - success_msg_writer() << tr("Secret spend key exported."); - m_wallet->rewrite(m_wallet_file, pwd_container->password()); - } - return true; -} -//---------------------------------------------------------------------------------------------------- bool simple_wallet::stop_mining(const std::vector& args) { if (!try_connect_to_daemon()) diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index 4e058f815..6cd7ed7af 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -160,7 +160,6 @@ namespace cryptonote bool apropos(const std::vector &args); bool scan_tx(const std::vector &args); bool start_mining(const std::vector &args); - bool export_key(const std::vector &args); bool stop_mining(const std::vector &args); bool set_daemon(const std::vector &args); bool save_bc(const std::vector &args);