We study the hotspots of powerful radiogalaxies, where electrons accelerated at the jet termination shock emit synchrotron radiation. The turnover of the synchrotron spectrum is typically observed between infrared and optical frequencies, indicating that the maximum energy of non-thermal electrons accelerated at the shock is ~TeV for a canonical magnetic field of ~100 micro Gauss. We show that this maximum energy cannot be constrained by synchrotron losses as usually assumed, unless the jet density is unreasonably large and most of the jet upstream energy goes to non-thermal particles. We test this result by considering a sample of hotspots observed at radio, infrared and optical wavelengths.