bitcoin/bitcoin — pull request #1612 by luke-jr (2012-07-19 20:09:42+00:00)
Title: Optimize JSON-RPC getblockhash

- If the height is in the first half, start at the genesis block and go up, rather than at the top
- Cache the last lookup and use it as a reference point if it's close to the next request, to make linear lookups always fast