From 8becdb3ef5077216ad464f7c71ba62aacb11ba33 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Tue, 8 Oct 2024 16:05:12 +1100 Subject: [PATCH] 7311: Redo getPeer again to include hasAvailableRequestCapacity check Signed-off-by: Matilda Clerke --- .../org/hyperledger/besu/ethereum/eth/manager/EthPeers.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java index 47ceba6598..d070c35ce1 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java @@ -470,7 +470,7 @@ public class EthPeers implements PeerSelector { // Part of the PeerSelector interface, to be split apart later @Override public Optional getPeer(final Predicate filter) { - return bestPeerMatchingCriteria(filter); + return streamBestPeers().filter(filter).filter(EthPeer::hasAvailableRequestCapacity).findFirst(); } // Part of the PeerSelector interface, to be split apart later