diff options
author | Neozaru <neozaru@mailoo.org> | 2014-05-25 00:20:46 +0200 |
---|---|---|
committer | Neozaru <neozaru@mailoo.org> | 2014-05-25 00:20:46 +0200 |
commit | 17a9ee3f8f2d8af23f9f4f3f27b38fd7f9d90c2b (patch) | |
tree | 36ee227e326183cadd8c877d2c7850ab10025663 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #1 from monero-project/master (diff) | |
download | monero-17a9ee3f8f2d8af23f9f4f3f27b38fd7f9d90c2b.tar.xz |
'getaddress' wallet-rpc command
Diffstat (limited to '')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index f1766c3b4..55f81aacc 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -71,6 +71,21 @@ namespace tools return true; } //------------------------------------------------------------------------------------------------------------------------------ + bool wallet_rpc_server::on_getaddress(const wallet_rpc::COMMAND_RPC_GET_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_GET_ADDRESS::response& res, epee::json_rpc::error& er, connection_context& cntx) + { + try + { + res.address = m_wallet.get_account().get_public_address_str(); + } + catch (std::exception& e) + { + er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR; + er.message = e.what(); + return false; + } + return true; + } + //------------------------------------------------------------------------------------------------------------------------------ bool wallet_rpc_server::on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::request& req, wallet_rpc::COMMAND_RPC_TRANSFER::response& res, epee::json_rpc::error& er, connection_context& cntx) { |