aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorJakob Lind <karl.jakob.lind@gmail.com>2014-08-05 08:17:23 +0200
committerJakob Lind <karl.jakob.lind@gmail.com>2014-08-05 08:17:23 +0200
commit0c3255ead8132c9903aa3b62333460fc3ed67713 (patch)
tree81b47a2cd57c216e7d1d2ef1aaa1f7bb818e4c94 /src/wallet/wallet_rpc_server.cpp
parentrefactoring. get seed code in wallet2 (diff)
downloadmonero-0c3255ead8132c9903aa3b62333460fc3ed67713.tar.xz
query_key command in wallet rpc.
only support mnemonic as key_type currently
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet_rpc_server.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 063716a9e..26da8d434 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -403,4 +403,22 @@ namespace tools
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
+ bool wallet_rpc_server::on_query_key(const wallet_rpc::COMMAND_RPC_QUERY_KEY::request& req, wallet_rpc::COMMAND_RPC_QUERY_KEY::response& res, epee::json_rpc::error& er, connection_context& cntx)
+ {
+ if (req.key_type.compare("mnemonic") == 0)
+ {
+ if (!m_wallet.get_seed(res.key))
+ {
+ er.message = "The wallet is non-deterministic. Cannot display seed.";
+ return false;
+ }
+ }
+ else
+ {
+ er.message = "key_type " + req.key_type + " not found";
+ return false;
+ }
+
+ return true;
+ }
}