bitcoin/bitcoin — pull request #5057 by laanwj (2014-10-07 16:11:29+00:00)
Title: Make -reindex cope with out-of-order blocks

Remember out-of-order block headers along with their disk positions. This is likely the simplest and least-impact way to make -reindex work with headers first.

Based on top of #4468, only the last commit is mine.