From e3c465e6643dbf4ee8d3df34fadaa85cca38c172 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 7a6f94e2720..c558ea2b763 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 synchronized void prependAncestorsHeader(final BlockHeader blockHeader) { 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);