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

Function clearbanned

src/rpc/net.cpp:802–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800}
801
802static RPCHelpMan clearbanned()
803{
804 return RPCHelpMan{"clearbanned",
805 "\nClear all banned IPs.\n",
806 {},
807 RPCResult{RPCResult::Type::NONE, "", ""},
808 RPCExamples{
809 HelpExampleCli("clearbanned", "")
810 + HelpExampleRpc("clearbanned", "")
811 },
812 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
813{
814 NodeContext& node = EnsureAnyNodeContext(request.context);
815 if (!node.banman) {
816 throw JSONRPCError(RPC_DATABASE_ERROR, "Error: Ban database not loaded");
817 }
818
819 node.banman->ClearBanned();
820
821 return NullUniValue;
822},
823 };
824}
825
826static RPCHelpMan setnetworkactive()
827{

Callers

nothing calls this directly

Calls 4

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
JSONRPCErrorFunction · 0.85
ClearBannedMethod · 0.80

Tested by

no test coverage detected