Skip to content

Commit

Permalink
Fix PR 4098 (hyperledger#4106)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 authored and codyborn committed Jul 31, 2022
1 parent 54515eb commit e3c465e
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e3c465e

Please sign in to comment.