From 8c70524fc6031dcc268fd771797f35d6229848e7 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 2 Aug 2023 20:39:09 +0200 Subject: [PATCH] chore: dont penalize on dropped connections (#4031) --- crates/net/network/src/transactions.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/net/network/src/transactions.rs b/crates/net/network/src/transactions.rs index 55c434593e..d05c741727 100644 --- a/crates/net/network/src/transactions.rs +++ b/crates/net/network/src/transactions.rs @@ -491,7 +491,8 @@ where RequestError::UnsupportedCapability => ReputationChangeKind::BadProtocol, RequestError::Timeout => ReputationChangeKind::Timeout, RequestError::ChannelClosed | RequestError::ConnectionDropped => { - ReputationChangeKind::Dropped + // peer is already disconnected + return } RequestError::BadResponse => ReputationChangeKind::BadTransactions, }; @@ -561,7 +562,8 @@ where this.on_request_error(req.peer_id, req_err); } Poll::Ready(Err(_)) => { - this.on_request_error(req.peer_id, RequestError::ConnectionDropped) + // request channel closed/dropped + this.on_request_error(req.peer_id, RequestError::ChannelClosed) } } }