| 44 | }; |
| 45 | |
| 46 | static RPCHelpMan getconnectioncount() |
| 47 | { |
| 48 | return RPCHelpMan{"getconnectioncount", |
| 49 | "\nReturns the number of connections to other nodes.\n", |
| 50 | {}, |
| 51 | RPCResult{ |
| 52 | RPCResult::Type::NUM, "", "The connection count" |
| 53 | }, |
| 54 | RPCExamples{ |
| 55 | HelpExampleCli("getconnectioncount", "") |
| 56 | + HelpExampleRpc("getconnectioncount", "") |
| 57 | }, |
| 58 | [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue |
| 59 | { |
| 60 | NodeContext& node = EnsureAnyNodeContext(request.context); |
| 61 | const CConnman& connman = EnsureConnman(node); |
| 62 | |
| 63 | return (int)connman.GetNodeCount(ConnectionDirection::Both); |
| 64 | }, |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | static RPCHelpMan ping() |
| 69 | { |
nothing calls this directly
no test coverage detected