| 65 | }; |
| 66 | |
| 67 | static RPCMethod getconnectioncount() |
| 68 | { |
| 69 | return RPCMethod{ |
| 70 | "getconnectioncount", |
| 71 | "Returns the number of connections to other nodes.\n", |
| 72 | {}, |
| 73 | RPCResult{ |
| 74 | RPCResult::Type::NUM, "", "The connection count" |
| 75 | }, |
| 76 | RPCExamples{ |
| 77 | HelpExampleCli("getconnectioncount", "") |
| 78 | + HelpExampleRpc("getconnectioncount", "") |
| 79 | }, |
| 80 | [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue |
| 81 | { |
| 82 | NodeContext& node = EnsureAnyNodeContext(request.context); |
| 83 | const CConnman& connman = EnsureConnman(node); |
| 84 | |
| 85 | return connman.GetNodeCount(ConnectionDirection::Both); |
| 86 | }, |
| 87 | }; |
| 88 | } |
| 89 | |
| 90 | static RPCMethod ping() |
| 91 | { |
nothing calls this directly
no test coverage detected