MCPcopy Create free account
hub / github.com/ElementsProject/elements / setnetworkactive

Function setnetworkactive

src/rpc/net.cpp:826–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

824}
825
826static RPCHelpMan setnetworkactive()
827{
828 return RPCHelpMan{"setnetworkactive",
829 "\nDisable/enable all p2p network activity.\n",
830 {
831 {"state", RPCArg::Type::BOOL, RPCArg::Optional::NO, "true to enable networking, false to disable"},
832 },
833 RPCResult{RPCResult::Type::BOOL, "", "The value that was passed in"},
834 RPCExamples{""},
835 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
836{
837 NodeContext& node = EnsureAnyNodeContext(request.context);
838 CConnman& connman = EnsureConnman(node);
839
840 connman.SetNetworkActive(request.params[0].get_bool());
841
842 return connman.GetNetworkActive();
843},
844 };
845}
846
847static RPCHelpMan getnodeaddresses()
848{

Callers

nothing calls this directly

Calls 3

SetNetworkActiveMethod · 0.80
get_boolMethod · 0.80
GetNetworkActiveMethod · 0.80

Tested by

no test coverage detected