Our intention is to study, in the framework of a very simple optimal growth model, the consequences on the optimal paths followed by consumption and the environmental quality of an endogenous discounting. Consumption directly comes from the use of environmental services and so is a direct cause of environmental degradation. The environment is valued both as a source of consumption and as an amenity. For a sustainability concern, we introduce an endogenous discount rate growing with the environmental quality, and compare the optimal growth paths with the ones obtained in the usual case of exogenous and constant discounting. We show that the convergence of the environmental quality toward a steady state occurs only for a very special configuration of the parameters in the exogenous discounting case, whereas it occurs generically in the endogenous discounting one. This happens for a utility discount rate becoming sufficiently high when the environmental quality is high and sufficiently low when the environmental quality is poor. In this case, then, endogenous discounting with a positive marginal discount rate allows us to avoid the depletion of the environment.