Algorithms are studied for distributed least-squares (DLS) estimation of a scalar target signal in sensor networks. Due to the observation locality and the limited sensing ability, the individual sensor estimates are far from being reliable. To obtain a more reliable estimate of the target signal, the sensors could collaborate by iteratively exchanging messages with their neighbors, to refine their local estimates over time. Such an iterative DLS algorithm is investigated in this paper with and without the consideration of node failures. In particular, without sensor node failures it is shown that every instantiation of the DLS algorithm converges, i.e., consensus is reached among the sensors, with the limiting agreement value being the centralized least-squares estimate. With node failures during the iterative exchange process, the convergence of the DLS algorithm is still guaranteed; however, an error exists between the limiting agreement value and the centralized least-squares estimate. In order to reduce this error, a modified DLS scheme, the M-DLS, is provided. The M-DLS algorithm involves an additional weight compensation step, in which a sensor performs a one-time weight compensation procedure whenever it detects the failure of a neighbor. Through analytical arguments and simulations, it is shown that the M-DLS algorithm leads to a smaller error than the DLS algorithm, where the magnitude of the improvement dependents on the network topology.