code: func (s *server) setNextBatch(from, to uint64) ([]byte, uint64, uint64, *HandoverProof, error) {
  	if s.stream.Live {
  		if from == 0 {
  			from = s.sessionIndex
  		}
  		if to <= from || from >= s.sessionIndex {
  			to = math.MaxUint64
  		}
  	} else {
  		if (to < from && to != 0) || from > s.sessionIndex {
  			return nil, 0, 0, nil, nil
  		}
  		if to == 0 || to > s.sessionIndex {
  			to = s.sessionIndex
  		}
  	}
  	return s.SetNextBatch(from, to)
  }
docs: // setNextBatch adjusts passed interval based on session index and whether
  // stream is live or history. It calls Server SetNextBatch with adjusted
  // interval and returns batch hashes and their interval.