mirror of
https://github.com/monero-project/monero.git
synced 2025-06-12 00:02:58 -04:00
query_key command in wallet rpc.
only support mnemonic as key_type currently
This commit is contained in:
parent
2ba77629ad
commit
0c3255ead8
3 changed files with 44 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue