package pilorama

// nextTimestamp accepts the latest local timestamp, node position in a container and container size.
// Returns the next timestamp which can be generated by this node.
func nextTimestamp(ts Timestamp, pos, size uint64) Timestamp {
	base := ts/size*size + pos
	if ts < base {
		return base
	}
	return base + size
}
