Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/server.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | UniValue RPCServer::ExecuteCommand(Config &config, | ||||
// context-free RPC commands via an implementation of RPCCommand. | // context-free RPC commands via an implementation of RPCCommand. | ||||
// Check if context-free RPC method is valid and execute it | // Check if context-free RPC method is valid and execute it | ||||
return tableRPC.execute(config, request); | return tableRPC.execute(config, request); | ||||
} | } | ||||
void RPCServer::RegisterCommand(std::unique_ptr<RPCCommand> command) { | void RPCServer::RegisterCommand(std::unique_ptr<RPCCommand> command) { | ||||
if (command != nullptr) { | if (command != nullptr) { | ||||
const std::string &commandName = command->GetName(); | |||||
commands.getWriteView()->insert( | commands.getWriteView()->insert( | ||||
std::make_pair(command->GetName(), std::move(command))); | std::make_pair(commandName, std::move(command))); | ||||
} | } | ||||
} | } | ||||
static struct CRPCSignals { | static struct CRPCSignals { | ||||
boost::signals2::signal<void()> Started; | boost::signals2::signal<void()> Started; | ||||
boost::signals2::signal<void()> Stopped; | boost::signals2::signal<void()> Stopped; | ||||
boost::signals2::signal<void(const ContextFreeRPCCommand &)> PreCommand; | boost::signals2::signal<void(const ContextFreeRPCCommand &)> PreCommand; | ||||
} g_rpcSignals; | } g_rpcSignals; | ||||
▲ Show 20 Lines • Show All 530 Lines • Show Last 20 Lines |