| 469 | } |
| 470 | |
| 471 | static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler) |
| 472 | { |
| 473 | try |
| 474 | { |
| 475 | RPCCommandExecution execution(request.strMethod); |
| 476 | // Execute, convert arguments to array if necessary |
| 477 | if (request.params.isObject()) { |
| 478 | return command.actor(transformNamedArguments(request, command.argNames), result, last_handler); |
| 479 | } else { |
| 480 | return command.actor(request, result, last_handler); |
| 481 | } |
| 482 | } |
| 483 | catch (const std::exception& e) |
| 484 | { |
| 485 | throw JSONRPCError(RPC_MISC_ERROR, e.what()); |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | std::vector<std::string> CRPCTable::listCommands() const |
| 490 | { |
no test coverage detected