Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/server.cpp
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | static const CRPCCommand vRPCCommands[] = { | ||||
{ "control", "getrpcinfo", getrpcinfo, {} }, | { "control", "getrpcinfo", getrpcinfo, {} }, | ||||
{ "control", "help", help, {"command"} }, | { "control", "help", help, {"command"} }, | ||||
{ "control", "stop", stop, {"wait"} }, | { "control", "stop", stop, {"wait"} }, | ||||
{ "control", "uptime", uptime, {} }, | { "control", "uptime", uptime, {} }, | ||||
}; | }; | ||||
// clang-format on | // clang-format on | ||||
CRPCTable::CRPCTable() { | CRPCTable::CRPCTable() { | ||||
unsigned int vcidx; | for (const auto &c : vRPCCommands) { | ||||
for (vcidx = 0; vcidx < (sizeof(vRPCCommands) / sizeof(vRPCCommands[0])); | appendCommand(c.name, &c); | ||||
vcidx++) { | |||||
const CRPCCommand *pcmd; | |||||
pcmd = &vRPCCommands[vcidx]; | |||||
mapCommands[pcmd->name].push_back(pcmd); | |||||
} | } | ||||
} | } | ||||
bool CRPCTable::appendCommand(const std::string &name, | bool CRPCTable::appendCommand(const std::string &name, | ||||
const CRPCCommand *pcmd) { | const CRPCCommand *pcmd) { | ||||
if (IsRPCRunning()) { | if (IsRPCRunning()) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |