diff options
author | Jakob Lind <karl.jakob.lind@gmail.com> | 2014-08-05 08:17:23 +0200 |
---|---|---|
committer | Jakob Lind <karl.jakob.lind@gmail.com> | 2014-08-05 08:17:23 +0200 |
commit | 0c3255ead8132c9903aa3b62333460fc3ed67713 (patch) | |
tree | 81b47a2cd57c216e7d1d2ef1aaa1f7bb818e4c94 /src/wallet/wallet_rpc_server.cpp | |
parent | refactoring. get seed code in wallet2 (diff) | |
download | monero-0c3255ead8132c9903aa3b62333460fc3ed67713.tar.xz |
query_key command in wallet rpc.
only support mnemonic as key_type currently
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 18 |
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; + } } |