bitcoin/bitcoin — pull request #1315 by sipa (2012-05-15 15:40:50+00:00)
Title: Hopefully final fix for the stuck blockchain issue

Immediately issue a "getblocks", instead of a "getdata" (which will trigger the relevant "inv" to be sent anyway), and only do so when the previous set of invs led us into a known and attached part of the block tree.

This patch has been tested on a (constructed) blockchain that was effectively stuck.