aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authormonero-project <sempre.amaro@gmail.com>2014-06-01 12:29:43 -0400
committermonero-project <sempre.amaro@gmail.com>2014-06-01 12:29:43 -0400
commit7649f54e0198b88c2df6b58420805fda9439a6d0 (patch)
tree0890c9ee74331cd1f27093833718d3cf7eb20d26 /src/rpc/core_rpc_server.cpp
parentMerge branch '0.8.8update' (diff)
parentMerge bitmonero@monero-project (diff)
downloadmonero-7649f54e0198b88c2df6b58420805fda9439a6d0.tar.xz
Merge pull request #14 from Neozaru/master
'get_address' RPC method for 'simplewallet'
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 8779f73d8..a724246f1 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -275,6 +275,24 @@ namespace cryptonote
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
+ bool core_rpc_server::on_mining_status(const COMMAND_RPC_MINING_STATUS::request& req, COMMAND_RPC_MINING_STATUS::response& res, connection_context& cntx)
+ {
+ CHECK_CORE_READY();
+
+ const miner& lMiner = m_core.get_miner();
+ res.active = lMiner.is_mining();
+
+ if ( lMiner.is_mining() ) {
+ res.speed = lMiner.get_speed();
+ res.threads_count = lMiner.get_threads_count();
+ const account_public_address& lMiningAdr = lMiner.get_mining_address();
+ res.address = get_account_address_as_str(lMiningAdr);
+ }
+
+ res.status = CORE_RPC_STATUS_OK;
+ return true;
+ }
+ //------------------------------------------------------------------------------------------------------------------------------
bool core_rpc_server::on_save_bc(const COMMAND_RPC_SAVE_BC::request& req, COMMAND_RPC_SAVE_BC::response& res, connection_context& cntx)
{
CHECK_CORE_READY();