aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorNeozaru <neozaru@mailoo.org>2014-05-25 00:20:46 +0200
committerNeozaru <neozaru@mailoo.org>2014-05-25 00:20:46 +0200
commit17a9ee3f8f2d8af23f9f4f3f27b38fd7f9d90c2b (patch)
tree36ee227e326183cadd8c877d2c7850ab10025663 /src/wallet/wallet_rpc_server.cpp
parentMerge pull request #1 from monero-project/master (diff)
downloadmonero-17a9ee3f8f2d8af23f9f4f3f27b38fd7f9d90c2b.tar.xz
'getaddress' wallet-rpc command
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet_rpc_server.cpp15
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)
{