Added get_connections RPC call to daemon

This commit is contained in:
Thomas Winget
2014-07-18 19:33:03 -04:00
parent 905b67bc79
commit 9f88b7ce6b
6 changed files with 116 additions and 0 deletions

View File

@@ -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;
}
//------------------------------------------------------------------------------------------------------------------------------
}