bitcoin/bitcoin — pull request #948 by sipa (2012-03-18 22:52:45+00:00)
Title: Prevent stuck block download in large reorganisations

In cases of very large reorganisations (hundreds of blocks), a situation may appear where an 'inv' is sent as response to a 'getblocks', but the last block mentioned in the inv is already known to the receiver node. However, the supplying node uses a request for this last block as a trigger to send the rest of the inv blocks. If it never comes, the block chain download is stuck.

Thispull request makes the receiver node always request the last inv'ed block, even if it is already known, to prevent this problem.