aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Lind <karl.jakob.lind@gmail.com>2014-08-05 08:53:30 +0200
committerJakob Lind <karl.jakob.lind@gmail.com>2014-08-05 08:53:30 +0200
commitda523f30fcd42d920f1246d7823815e86d6748de (patch)
tree72765baf2d7676da80066c2d5ec034a177ebbea4
parentquery_key command in wallet rpc. (diff)
downloadmonero-da523f30fcd42d920f1246d7823815e86d6748de.tar.xz
added viewkey command to CLI
-rw-r--r--src/simplewallet/simplewallet.cpp8
-rw-r--r--src/simplewallet/simplewallet.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 58706338a..960b1be9d 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -188,6 +188,13 @@ std::string simple_wallet::get_commands_str()
return ss.str();
}
+bool simple_wallet::viewkey(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
+{
+ success_msg_writer() << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << std::endl;
+
+ return true;
+}
+
bool simple_wallet::seed(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
{
std::string electrum_words;
@@ -227,6 +234,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("viewkey", boost::bind(&simple_wallet::viewkey, this, _1), "Get viewkey");
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 a8e7d83a6..41197b4bb 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 viewkey(const std::vector<std::string> &args = std::vector<std::string>());
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);