MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / execute

Method execute

src/rpc/server.cpp:474–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474UniValue CRPCTable::execute(const JSONRPCRequest &request) const
475{
476 // Return immediately if in warmup
477 {
478 LOCK(cs_rpcWarmup);
479 if (fRPCInWarmup)
480 throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
481 }
482
483 // Find method
484 const CRPCCommand *pcmd = tableRPC[request.strMethod];
485 if (!pcmd)
486 throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found");
487
488 g_rpcSignals.PreCommand(*pcmd);
489
490 try
491 {
492 // Execute, convert arguments to array if necessary
493 if (request.params.isObject()) {
494 return pcmd->actor(transformNamedArguments(request, pcmd->argNames));
495 } else {
496 return pcmd->actor(request);
497 }
498 }
499 catch (const std::exception& e)
500 {
501 throw JSONRPCError(RPC_MISC_ERROR, e.what());
502 }
503}
504
505std::vector<std::string> CRPCTable::listCommands() const
506{

Callers 3

HTTPReq_JSONRPCFunction · 0.45
JSONRPCExecOneFunction · 0.45
executeRpcMethod · 0.45

Calls 4

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

Tested by

no test coverage detected