code: func (s *ticketStore) nextRegisterLookup() (lookupInfo, time.Duration) {
  	// Queue up any new topics (or discarded ones), preserving iteration order
  	for topic := range s.tickets {
  		if _, ok := s.regSet[topic]; !ok {
  			s.regQueue = append(s.regQueue, topic)
  			s.regSet[topic] = struct{}{}
  		}
  	}
  	// Iterate over the set of all topics and look up the next suitable one
  	for len(s.regQueue) > 0 {
  		// Fetch the next topic from the queue, and ensure it still exists
  		topic := s.regQueue[0]
  		s.regQueue = s.regQueue[1:]
  		delete(s.regSet, topic)
  
  		if s.tickets[topic] == nil {
  			continue
  		}
  		// If the topic needs more tickets, return it
  		if s.tickets[topic].nextLookup < mclock.Now() {
  			next, delay := s.radius[topic].nextTarget(false), 100*time.Millisecond
  			log.Trace("Found discovery topic to register", "topic", topic, "target", next.target, "delay", delay)
  			return next, delay
  		}
  	}
  	// No registration topics found or all exhausted, sleep
  	delay := 40 * time.Second
  	log.Trace("No topic found to register", "delay", delay)
  	return lookupInfo{}, delay
  }
docs: // nextRegisterLookup returns the target of the next lookup for ticket collection.