MCPcopy Create free account
hub / github.com/LUX-Core/lux / execute

Method execute

src/rpcserver.cpp:609–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609UniValue CRPCTable::execute(const std::string& strMethod, const UniValue& params) const
610{
611 // Return immediately if in warmup
612 {
613 LOCK(cs_rpcWarmup);
614 if (fRPCInWarmup)
615 throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
616 }
617
618 // Find method
619 const CRPCCommand* pcmd = tableRPC[strMethod];
620 if (!pcmd)
621 throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found");
622 g_rpcSignals.PreCommand(*pcmd);
623
624 try {
625 // Execute
626 return pcmd->actor(params, false);
627
628 } catch (std::exception& e) {
629 throw JSONRPCError(RPC_MISC_ERROR, e.what());
630 }
631 g_rpcSignals.PostCommand(*pcmd);
632}
633
634vector<string> CRPCTable::listCommands() const
635{

Callers 3

HTTPReq_JSONRPCFunction · 0.45
JSONRPCExecOneFunction · 0.45
performByteCodeMethod · 0.45

Calls 2

JSONRPCErrorFunction · 0.85
whatMethod · 0.45

Tested by

no test coverage detected