Researching on delay tolerant networks is an emerging field. Many researchers are dedicated to the approach of the routing algorithms and its applications. With sufficient energy in the core-nodes in the networks, a nested source spray and wait routing algorithm, which is ameliorated from source spray and wait routing algorithm, has been put forward in this paper. The simulation results indicate that by increasing the cost of energy consumption at the core-nodes, this routing algorithm has better performances in terms of delivery probability and the average delay.