Trait EthResponseValidator
pub trait EthResponseValidator {
// Required methods
fn is_likely_bad_headers_response(&self, request: &HeadersRequest) -> bool;
fn reputation_change_err(&self) -> Option<ReputationChangeKind>;
}Expand description
Helper trait used to validate responses.
Required Methods§
fn is_likely_bad_headers_response(&self, request: &HeadersRequest) -> bool
fn is_likely_bad_headers_response(&self, request: &HeadersRequest) -> bool
Determine whether the response matches what we requested in HeadersRequest
fn reputation_change_err(&self) -> Option<ReputationChangeKind>
fn reputation_change_err(&self) -> Option<ReputationChangeKind>
Return the response reputation impact if any
Implementations on Foreign Types§
§impl<H> EthResponseValidator for Result<Vec<H>, RequestError>where
H: BlockHeader,
impl<H> EthResponseValidator for Result<Vec<H>, RequestError>where
H: BlockHeader,
§fn reputation_change_err(&self) -> Option<ReputationChangeKind>
fn reputation_change_err(&self) -> Option<ReputationChangeKind>
RequestError::ChannelClosed is not possible here since these errors are mapped to
ConnectionDropped, which will be handled when the dropped connection is cleaned up.
RequestError::ConnectionDropped should be ignored here because this is already handled
when the dropped connection is handled.
RequestError::UnsupportedCapability is not used yet because we only support active
session for eth protocol.