aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2014-07-18 19:35:45 -0400
committerThomas Winget <tewinget@gmail.com>2014-07-18 19:35:45 -0400
commit1c33b6cbeeb0d8d6331287429cfd01f8222cfe7b (patch)
tree689d224568a6921f899bb592b7f6ed085f626445 /src/rpc/core_rpc_server.cpp
parentMerge pull request #63 from mikezackles/bytecoin_for_merge (diff)
parentAdded get_connections RPC call to daemon (diff)
downloadmonero-1c33b6cbeeb0d8d6331287429cfd01f8222cfe7b.tar.xz
Merge pull request #65 from tewinget/daemon_rpc
Added get_connections RPC call to daemon Only consists of new functionality and doesn't break build, merging per request.
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;
+ }
+ //------------------------------------------------------------------------------------------------------------------------------
}