From 94e6541ca172c11a6a1f1413d7ed79eb453f1220 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Thu, 14 Jul 2022 18:51:47 +0200 Subject: [PATCH] Fix PR 4098 (#4106) Signed-off-by: Fabio Di Fabio --- .../eth/sync/backwardsync/BackwardChain.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java index 7a6f94e272..c558ea2b76 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardChain.java @@ -95,22 +95,6 @@ public class BackwardChain { return; } BlockHeader firstHeader = firstStoredAncestor.get(); - if (firstHeader.getNumber() != blockHeader.getNumber() + 1) { - throw new BackwardSyncException( - "Wrong height of header " - + blockHeader.getHash().toHexString() - + " is " - + blockHeader.getNumber() - + " when we were expecting " - + (firstHeader.getNumber() - 1)); - } - if (!firstHeader.getParentHash().equals(blockHeader.getHash())) { - throw new BackwardSyncException( - "Hash of header does not match our expectations, was " - + blockHeader.toLogString() - + " when we expected " - + firstHeader.getParentHash().toHexString()); - } headers.put(blockHeader.getHash(), blockHeader); chainStorage.put(blockHeader.getHash(), firstStoredAncestor.get().getHash()); firstStoredAncestor = Optional.of(blockHeader);