Skip to content

Commit

Permalink
add simplewallet feature to dump private keys
Browse files Browse the repository at this point in the history
  • Loading branch information
valiant1x committed Jan 26, 2018
1 parent a1529a9 commit 726637c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/SimpleWallet/SimpleWallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ simple_wallet::simple_wallet(System::Dispatcher& dispatcher, const CryptoNote::C
"<mixin_count> is the number of transactions yours is indistinguishable from (from 0 to maximum available)");
m_consoleHandler.setHandler("set_log", boost::bind(&simple_wallet::set_log, this, _1), "set_log <level> - Change current log level, <level> is a number 0-4");
m_consoleHandler.setHandler("address", boost::bind(&simple_wallet::print_address, this, _1), "Show current wallet public address");
m_consoleHandler.setHandler("keys", boost::bind(&simple_wallet::print_keys, this, _1), "Show wallet private keys");
m_consoleHandler.setHandler("save", boost::bind(&simple_wallet::save, this, _1), "Save wallet synchronized data");
m_consoleHandler.setHandler("reset", boost::bind(&simple_wallet::reset, this, _1), "Discard cache data and start synchronizing from the start");
m_consoleHandler.setHandler("help", boost::bind(&simple_wallet::help, this, _1), "Show this help");
Expand Down Expand Up @@ -1056,6 +1057,15 @@ bool simple_wallet::print_address(const std::vector<std::string> &args/* = std::
return true;
}
//----------------------------------------------------------------------------------------------------
bool simple_wallet::print_keys(const std::vector<std::string> &args/* = std::vector<std::string>()*/) {
AccountKeys keys;
m_wallet->getAccountKeys(keys);
success_msg_writer() << "Address: " << m_wallet->getAddress();
success_msg_writer() << "Secret spend key: " << keys.spendSecretKey;
success_msg_writer() << "Secret view key: " << keys.viewSecretKey;
return true;
}
//----------------------------------------------------------------------------------------------------
bool simple_wallet::process_command(const std::vector<std::string> &args) {
return m_consoleHandler.runCommand(args);
}
Expand Down
1 change: 1 addition & 0 deletions src/SimpleWallet/SimpleWallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ namespace CryptoNote
bool listTransfers(const std::vector<std::string> &args);
bool transfer(const std::vector<std::string> &args);
bool print_address(const std::vector<std::string> &args = std::vector<std::string>());
bool print_keys(const std::vector<std::string> &args = std::vector<std::string>());
bool save(const std::vector<std::string> &args);
bool reset(const std::vector<std::string> &args);
bool set_log(const std::vector<std::string> &args);
Expand Down

0 comments on commit 726637c

Please sign in to comment.