MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / getconnectioncount

Function getconnectioncount

src/rpc/net.cpp:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <univalue.h>
25
26static UniValue getconnectioncount(const JSONRPCRequest& request)
27{
28 if (request.fHelp || request.params.size() != 0)
29 throw std::runtime_error(
30 "getconnectioncount\n"
31 "\nReturns the number of connections to other nodes.\n"
32 "\nResult:\n"
33 "n (numeric) The connection count\n"
34 "\nExamples:\n"
35 + HelpExampleCli("getconnectioncount", "")
36 + HelpExampleRpc("getconnectioncount", "")
37 );
38
39 if(!g_connman)
40 throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
41
42 return (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL);
43}
44
45static UniValue ping(const JSONRPCRequest& request)
46{

Callers

nothing calls this directly

Calls 5

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
JSONRPCErrorFunction · 0.85
GetNodeCountMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected