mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 17:18:08 -05:00
fix(net): add no response to backoff check (#610)
This commit is contained in:
@@ -89,7 +89,13 @@ impl SessionError for EthStreamError {
|
||||
}
|
||||
|
||||
fn should_backoff(&self) -> bool {
|
||||
self.as_disconnected()
|
||||
matches!(
|
||||
self,
|
||||
EthStreamError::P2PStreamError(P2PStreamError::HandshakeError(
|
||||
P2PHandshakeError::NoResponse
|
||||
))
|
||||
) || self
|
||||
.as_disconnected()
|
||||
.map(|reason| {
|
||||
matches!(
|
||||
reason,
|
||||
@@ -146,5 +152,10 @@ mod tests {
|
||||
|
||||
assert_eq!(err.as_disconnected(), Some(DisconnectReason::TooManyPeers));
|
||||
assert!(err.should_backoff());
|
||||
|
||||
let err = EthStreamError::P2PStreamError(P2PStreamError::HandshakeError(
|
||||
P2PHandshakeError::NoResponse,
|
||||
));
|
||||
assert!(err.should_backoff());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user