7311: Redo getPeer again to include hasAvailableRequestCapacity check

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
pull/7628/head
Matilda Clerke 2 months ago
parent 5aa6b0be5f
commit 8becdb3ef5
  1. 2
      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 // Part of the PeerSelector interface, to be split apart later
@Override @Override
public Optional<EthPeer> getPeer(final Predicate<EthPeer> filter) { public Optional<EthPeer> getPeer(final Predicate<EthPeer> filter) {
return bestPeerMatchingCriteria(filter); return streamBestPeers().filter(filter).filter(EthPeer::hasAvailableRequestCapacity).findFirst();
} }
// Part of the PeerSelector interface, to be split apart later // Part of the PeerSelector interface, to be split apart later

Loading…
Cancel
Save