diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncActions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncActions.java index 13c47b078fe..2eb6b460375 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncActions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncActions.java @@ -136,8 +136,7 @@ private CompletableFuture internalDownloadPivotBlockHeader( return ethContext .getEthPeers() - .waitForPeer( - (peer) -> true) + .waitForPeer((peer) -> true) .thenCompose( unused -> currentState diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotBlockConfirmer.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotBlockConfirmer.java index 69afa321971..8ceafb63730 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotBlockConfirmer.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotBlockConfirmer.java @@ -188,13 +188,10 @@ private CompletableFuture executePivotQuery(final long blockNumber) pivotHeaderFuture = ethContext .getEthPeers() - .waitForPeer( - (peer) -> - peer.chainState().getEstimatedHeight() >= blockNumber - && !pivotBlockQueriesByPeerId.containsKey(peer.nodeId())) + .waitForPeer((peer) -> !pivotBlockQueriesByPeerId.containsKey(peer.nodeId())) .orTimeout(5, TimeUnit.SECONDS) - .handle((r, e) -> null) // Ignore result, ensure even a timeout will result in calling - // executePivotQuery + // Ignore result, ensure even a timeout will result in calling executePivotQuery + .handle((r, e) -> null) .thenCompose(res -> executePivotQuery(blockNumber)); }