bitcoin/bitcoin — pull request #1282 by jgarzik (2012-05-13 07:15:13+00:00)
Title: Move hash->CBlockIndex BDB into its own database, blkhash.dat

blkindex.dat stores all kinds of data, and as such, each key is overloaded to
form a namespace. All keys beginning with "blockindex" form the
hash->CBlockIndex data that is loaded into mapBlockIndex.

This change moves mapBlockIndex data to its own database, custom tailored for
the sort of data we wish to store:

- BDB type changed from btree to hash
- key is uint256 hash, with no prefixes

Usage is cleaner, and uses slightly less CPU and disk space than the previous
solution.

COMPATIBILITY STATUS: A new block chain must be downloaded, or at least reindexed. As such, may want to delay this change, if other major database changes are planned.

MERGE STATUS: Ready for review and comment, but not ready for immediate upstreaming.