From 4744232a1c6dd6ac0bed303906d81883873b18d6 Mon Sep 17 00:00:00 2001 From: catbref Date: Fri, 10 May 2019 19:29:38 +0100 Subject: [PATCH] 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 --- src/main/java/org/qora/controller/Synchronizer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/qora/controller/Synchronizer.java b/src/main/java/org/qora/controller/Synchronizer.java index 298a9624..ec34fe03 100644 --- a/src/main/java/org/qora/controller/Synchronizer.java +++ b/src/main/java/org/qora/controller/Synchronizer.java @@ -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;