MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ExecuteCommand

Function ExecuteCommand

src/rpc/server.cpp:502–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler)
503{
504 try {
505 RPCCommandExecution execution(request.strMethod);
506 // Execute, convert arguments to array if necessary
507 if (request.params.isObject()) {
508 return command.actor(transformNamedArguments(request, command.argNames), result, last_handler);
509 } else {
510 return command.actor(request, result, last_handler);
511 }
512 } catch (const UniValue::type_error& e) {
513 throw JSONRPCError(RPC_TYPE_ERROR, e.what());
514 } catch (const std::exception& e) {
515 throw JSONRPCError(RPC_MISC_ERROR, e.what());
516 }
517}
518
519std::vector<std::string> CRPCTable::listCommands() const
520{

Callers 1

ExecuteCommandsFunction · 0.85

Calls 4

transformNamedArgumentsFunction · 0.85
JSONRPCErrorFunction · 0.85
isObjectMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected