code: func (m *model) OnHello(remoteID protocol.DeviceID, addr net.Addr, hello protocol.HelloResult) error {
  	if m.cfg.IgnoredDevice(remoteID) {
  		return errDeviceIgnored
  	}
  
  	cfg, ok := m.cfg.Device(remoteID)
  	if !ok {
  		m.cfg.AddOrUpdatePendingDevice(remoteID, hello.DeviceName, addr.String())
  		events.Default.Log(events.DeviceRejected, map[string]string{
  			"name":    hello.DeviceName,
  			"device":  remoteID.String(),
  			"address": addr.String(),
  		})
  		return errDeviceUnknown
  	}
  
  	if cfg.Paused {
  		return errDevicePaused
  	}
  
  	if len(cfg.AllowedNetworks) > 0 {
  		if !connections.IsAllowedNetwork(addr.String(), cfg.AllowedNetworks) {
  			return errNetworkNotAllowed
  		}
  	}
  
  	return nil
  }
docs: // OnHello is called when an device connects to us.
  // This allows us to extract some information from the Hello message
  // and add it to a list of known devices ahead of any checks.