From e3919bcb74808b833a9eb81058d3225a857c6ef6 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Tue, 17 Dec 2024 13:50:28 +1100 Subject: [PATCH] Use isSuitablePeer as peer selection criteria when waiting for a peer in AbstractRetryingPeerTask Signed-off-by: Matilda Clerke --- .../ethereum/eth/manager/task/AbstractRetryingPeerTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTask.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTask.java index 88765d48976..dd75a6eff98 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTask.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTask.java @@ -134,7 +134,7 @@ protected void handleTaskError(final Throwable error) { () -> ethContext .getEthPeers() - .waitForPeer((peer) -> true) + .waitForPeer(this::isSuitablePeer) .orTimeout(5, TimeUnit.SECONDS) // execute the task again .whenComplete((r, t) -> executeTaskTimed()));