  As a result of our limited data on reionization, the total optical depth for
electron scattering, $\tau$, limits precision measurements of cosmological
parameters from the Cosmic Microwave Background (CMB). It was recently shown
that the predicted 21-cm signal of neutral hydrogen contains enough information
to reconstruct $\tau$ with sub-percent accuracy, assuming that the neutral gas
was much hotter than the CMB throughout the entire epoch of reionization. Here
we relax this assumption and use the global 21-cm signal alone to extract
$\tau$ for realistic X-ray heating scenarios. We test our model-independent
approach using mock data for a wide range of ionization and heating histories
and show that an accurate measurement of the reionization optical depth at a
sub-percent level is possible in most of the considered scenarios even when
heating is not saturated during the epoch of reionization, assuming that the
foregrounds are mitigated. However, we find that in cases where heating sources
had hard X-ray spectra and their luminosity was close to or lower than what is
predicted based on low-redshift observations, the global 21-cm signal alone is
not a good tracer of the reionization history.
