Prevent stuck block download in large reorganisations
authorPieter Wuille <pieter.wuille@gmail.com>
Sun, 18 Mar 2012 22:47:26 +0000 (23:47 +0100)
committerLuke Dashjr <luke-jr+git@utopios.org>
Mon, 7 May 2012 02:44:45 +0000 (02:44 +0000)
commiteb3f661add15837434c286476a32e05f279a1919
tree973c0add06fc8ad808951be37907b0d834365b7c
parent607739befb6d4a647f03ed049b12222b1530f43c
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.

This commit makes the receiver node always request the last inv'ed block,
even if it is already known, to prevent this problem.
src/main.cpp