message: refactor: Add RPC server ExecuteCommands function
  No change in behavior. New function is split from CRPCTable::execute and
  used in the next commit.
diff: @@ -437,6 +437,16 @@ static inline JSONRPCRequest transformNamedArguments(const JSONRPCRequest& in, c
  return out;
  }
  +static bool ExecuteCommands(const std::vector<const CRPCCommand*>& commands, const JSONRPCRequest& request, UniValue& result)
  +{
  + for (const auto& command : commands) {
  + if (ExecuteCommand(*command, request, result, &command == &commands.back())) {
  + return true;
  + }
  + }
  + return false;
  +}
  +
  UniValue CRPCTable::execute(const JSONRPCRequest &request) const
  {
  // Return immediately if in warmup
  @@ -450,12 +460,10 @@ UniValue CRPCTable::execute(const JSONRPCRequest &request) const
  auto it = mapCommands.find(request.strMethod);
  if (it != mapCommands.end()) {
  UniValue result;
  - for (const auto& command : it->second) {
  - if (ExecuteCommand(*command, request, result, &command == &it->second.back())) {
  + if (ExecuteCommands(it->second, request, result)) {
  return result;
  }
  }
  - }
  throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found");
  }
  