| 607 | } |
| 608 | |
| 609 | UniValue 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 | |
| 634 | vector<string> CRPCTable::listCommands() const |
| 635 | { |
no test coverage detected