diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java index 03d4bc67a..434c03321 100644 --- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java +++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java @@ -437,7 +437,7 @@ public int compare(PeerAddress a, PeerAddress b) { try { this.headerChain = new BlockChain(params, new MemoryBlockStore(params)); StoredBlock cursor = chain.getChainHead(); - while (cursor != null) { + while (cursor != null && !cursor.getHeader().equals(params.getGenesisBlock())) { this.headerChain.getBlockStore().put(cursor); cursor = cursor.getPrev(chain.getBlockStore()); }