Added network get_info api call

This commit is contained in:
Nicolas Wack 2015-10-05 22:30:40 +02:00 committed by theoreticalbts
parent 6646957ce2
commit 7cb4140b97
2 changed files with 13 additions and 0 deletions

View file

@ -132,6 +132,13 @@ namespace graphene { namespace app {
{
}
fc::variant network_node_api::get_info() const
{
fc::mutable_variant_object result = _app.p2p_node()->network_get_info();
result["connection_count"] = _app.p2p_node()->get_connection_count();
return result;
}
void network_node_api::add_node(const fc::ip::endpoint& ep)
{
_app.p2p_node()->add_node(ep);

View file

@ -126,6 +126,11 @@ namespace graphene { namespace app {
public:
network_node_api(application& a);
/**
* @brief Return general network information, such as p2p port
*/
fc::variant get_info() const;
/**
* @brief add_node Connect to a new peer
* @param ep The IP/Port of the peer to connect to
@ -198,6 +203,7 @@ FC_API(graphene::app::network_broadcast_api,
(broadcast_block)
)
FC_API(graphene::app::network_node_api,
(get_info)
(add_node)
(get_connected_peers)
)