public boolean validateReceivedMessage(final EthMessage message, final String protocolName) {
    checkArgument(message.getPeer().equals(this), "Mismatched message sent to peer for dispatch");
    return getRequestManager(protocolName, message.getData().getCode())
        .map(requestManager -> requestManager.outstandingRequests() != 0)
        .orElse(true);
  }
Determines the validity of a message received from a peer. A message is considered valid if
either of the following conditions are met: 1) The message is a request type message (e.g.
GET_BLOCK_HEADERS), or 2) The message is a response type message (e.g. BLOCK_HEADERS), the node
has made at least 1 request for that type of message (i.e. it has sent at least 1
GET_BLOCK_HEADERS request), and it has at least 1 outstanding request of that type which it
expects to receive a response for.

@param message The message being validated
@param protocolName The protocol type of the message
@return true if the message is valid as per the above logic, otherwise false.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeer.java