code: func (a *Agent) addServiceLocked(service *structs.NodeService, chkTypes []*structs.CheckType, persist bool, token string, source configSource) error {
  	if err := a.validateService(service, chkTypes); err != nil {
  		return err
  	}
  
  	if a.config.EnableCentralServiceConfig {
  		return a.serviceManager.AddService(service, chkTypes, persist, token, source)
  	}
  
  	return a.addServiceInternal(service, chkTypes, persist, token, source)
  }
docs: // addServiceLocked adds a service entry to the service manager if enabled, or directly
  // to the local state if it is not. This function assumes the state lock is already held.