Peershares/Peershares — pull request #110 by sigmike (2014-04-21 08:07:52+00:00)
Title: Fixed initial download blocked every 500 PoS block

The problem is Proof of Stake blocks are not stored when the previous transaction of the CoinStake is missing. So the initial download process is broken.

Peercoin solved this by using the latest Proof of Work block as reference to download, but it doesn't work for Peershares where we only have PoS blocks.

To solve this:
The reference block is now the best block, whatever the proof.

The client asks for missing blocks when it receives a PoS block and it doesn't have the CoinStake previous transaction.

Block request are retried immediatly during initial download because the same last block is asked multiple times until we have the full chain.

Note that this fix only works if both nodes have applied it (the downloader and the seed).