Don't try to sync with a peer that only has genesis block

Was 85bc70b:
new testchain timestamp + don't try to sync with a peer that only has genesis block
This commit is contained in:
catbref 2019-05-10 19:29:38 +01:00
parent eac38d4212
commit 4744232a1c

View File

@ -83,6 +83,10 @@ public class Synchronizer {
LOGGER.info(String.format("Common block with peer %s is at height %d", peer, commonBlockHeight));
signatures.remove(0);
// If common block is genesis block then peer has no blocks so ignore them for a while
if (commonBlockHeight == 1)
return false;
// If common block is peer's latest block then we simply have a longer chain to peer, so exit now
if (commonBlockHeight == peerHeight)
return true;