code: func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint64, *HandoverProof, error) {
  	var batch []byte
  	i := 0
  
  	var ticker *time.Ticker
  	defer func() {
  		if ticker != nil {
  			ticker.Stop()
  		}
  	}()
  	var wait bool
  	for {
  		if wait {
  			if ticker == nil {
  				ticker = time.NewTicker(1000 * time.Millisecond)
  			}
  			select {
  			case <-ticker.C:
  			case <-s.quit:
  				return nil, 0, 0, nil, nil
  			}
  		}
  
  		metrics.GetOrRegisterCounter("syncer.setnextbatch.iterator", nil).Inc(1)
  		err := s.store.Iterator(from, to, s.po, func(key storage.Address, idx uint64) bool {
  			select {
  			case <-s.quit:
  				return false
  			default:
  			}
  			batch = append(batch, key[:]...)
  			i++
  			to = idx
  			return i < BatchSize
  		})
  		if err != nil {
  			return nil, 0, 0, nil, err
  		}
  		if len(batch) > 0 {
  			break
  		}
  		wait = true
  	}
  
  	log.Trace("Swarm syncer offer batch", "po", s.po, "len", i, "from", from, "to", to, "current store count", s.store.BinIndex(s.po))
  	return batch, from, to, nil, nil
  }
docs: // GetBatch retrieves the next batch of hashes from the dbstore