diff options
author | Jakob Lind <karl.jakob.lind@gmail.com> | 2014-08-01 15:40:18 +0200 |
---|---|---|
committer | Jakob Lind <karl.jakob.lind@gmail.com> | 2014-08-03 16:05:15 +0200 |
commit | 4fce57b9ad000354a872e2be630f194e3d12ea41 (patch) | |
tree | c3104a9fc518fbb3b40c8451b9f5e1e2bec7ff19 /src/simplewallet | |
parent | Merge pull request #81 from tewinget/restore-fix (diff) | |
download | monero-4fce57b9ad000354a872e2be630f194e3d12ea41.tar.xz |
added seed command to get deterministic seed.
not yet password protected
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 11 | ||||
-rw-r--r-- | src/simplewallet/simplewallet.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4bb5389e4..5b614c72a 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -188,6 +188,16 @@ std::string simple_wallet::get_commands_str() return ss.str(); } +bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<std::string>()*/) +{ + std::string electrum_words; + crypto::ElectrumWords::bytes_to_words(m_wallet->get_account().get_keys().m_spend_secret_key, electrum_words); + + success_msg_writer(true) << "\nPLEASE NOTE: the following 24 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. You will not be able to view these words again, so it is imperative to make note of them now.\n"; + std::cout << electrum_words << std::endl; + return true; +} + bool simple_wallet::help(const std::vector<std::string> &args/* = std::vector<std::string>()*/) { success_msg_writer() << get_commands_str(); @@ -210,6 +220,7 @@ simple_wallet::simple_wallet() m_cmd_binder.set_handler("set_log", boost::bind(&simple_wallet::set_log, this, _1), "set_log <level> - Change current log detalization level, <level> is a number 0-4"); m_cmd_binder.set_handler("address", boost::bind(&simple_wallet::print_address, this, _1), "Show current wallet public address"); m_cmd_binder.set_handler("save", boost::bind(&simple_wallet::save, this, _1), "Save wallet synchronized data"); + m_cmd_binder.set_handler("seed", boost::bind(&simple_wallet::seed, this, _1), "Get deterministic seed"); m_cmd_binder.set_handler("help", boost::bind(&simple_wallet::help, this, _1), "Show this help"); } //---------------------------------------------------------------------------------------------------- diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index 6214f7a5c..a8e7d83a6 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -70,6 +70,7 @@ namespace cryptonote bool open_wallet(const std::string &wallet_file, const std::string& password); bool close_wallet(); + bool seed(const std::vector<std::string> &args = std::vector<std::string>()); bool help(const std::vector<std::string> &args = std::vector<std::string>()); bool start_mining(const std::vector<std::string> &args); bool stop_mining(const std::vector<std::string> &args); |