aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2014-07-18 19:33:03 -0400
committerThomas Winget <tewinget@gmail.com>2014-07-18 19:33:03 -0400
commit9f88b7ce6bc9845e097a6d67f3d3c97110b819c1 (patch)
tree689d224568a6921f899bb592b7f6ed085f626445 /src/rpc/core_rpc_server.cpp
parentMerge pull request #63 from mikezackles/bytecoin_for_merge (diff)
downloadmonero-9f88b7ce6bc9845e097a6d67f3d3c97110b819c1.tar.xz
Added get_connections RPC call to daemon
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index c3f98563d..1334b5137 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -604,4 +604,20 @@ namespace cryptonote
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
+ bool core_rpc_server::on_get_connections(const COMMAND_RPC_GET_CONNECTIONS::request& req, COMMAND_RPC_GET_CONNECTIONS::response& res, epee::json_rpc::error& error_resp, connection_context& cntx)
+ {
+ if(!check_core_busy())
+ {
+ error_resp.code = CORE_RPC_ERROR_CODE_CORE_BUSY;
+ error_resp.message = "Core is busy.";
+ return false;
+ }
+
+ res.connections = m_p2p.get_payload_object().get_connections();
+
+ res.status = CORE_RPC_STATUS_OK;
+
+ return true;
+ }
+ //------------------------------------------------------------------------------------------------------------------------------
}