Skip to content

Commit

Permalink
Revert "Fix for backward sync wrongly thinking it is done after a Bes…
Browse files Browse the repository at this point in the history
…u restart"

This reverts commit e7ac9e5.

# Conflicts:
#	ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContext.java
  • Loading branch information
fab-10 committed Mar 7, 2023
1 parent c2c88b1 commit 7476309
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ public synchronized void updateHead(final Hash headHash) {
}

public synchronized CompletableFuture<Void> syncBackwardsUntil(final Hash newBlockHash) {
backwardChain.addNewHash(newBlockHash);
if (!isTrusted(newBlockHash)) {
backwardChain.addNewHash(newBlockHash);
}

final Status status = getOrStartSyncSession();
backwardChain
Expand All @@ -131,7 +133,9 @@ public synchronized CompletableFuture<Void> syncBackwardsUntil(final Block newPi
backwardChain.appendTrustedBlock(newPivot);
}

return syncBackwardsUntil(newPivot.getHeader().getParentHash());
final Status status = getOrStartSyncSession();
status.updateTargetHeight(newPivot.getHeader().getNumber());
return status.currentFuture;
}

private Status getOrStartSyncSession() {
Expand Down

0 comments on commit 7476309

Please sign in to comment.