From 663ed6c842a1dba4d66b6dcdd4b0b214a564fe33 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 23 Feb 2021 10:54:48 +1000 Subject: [PATCH] Revert "Remove remaining references to fail_with" This reverts commit 5e4bf804aa69fa79e4e4300b74ec2e3824fc0bc4. --- zebra-network/src/peer/connection.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zebra-network/src/peer/connection.rs b/zebra-network/src/peer/connection.rs index 3d952d66f..a411ab9d4 100644 --- a/zebra-network/src/peer/connection.rs +++ b/zebra-network/src/peer/connection.rs @@ -783,9 +783,9 @@ where /// Given a `req` originating from the peer, drive it to completion and send /// any appropriate messages to the remote peer. If an error occurs while - /// processing the request (e.g., the service is shedding load), then we - /// return a peer error, which terminates the entire peer connection, - /// shrinking the number of connected peers. + /// processing the request (e.g., the service is shedding load), then we call + /// fail_with to terminate the entire peer connection, shrinking the number + /// of connected peers. async fn drive_peer_request(&mut self, req: Request) -> Result<(), PeerError> { trace!(?req); use tower::{load_shed::error::Overloaded, ServiceExt}; @@ -805,8 +805,8 @@ where } else { // We could send a reject to the remote peer, but that might cause // them to disconnect, and we might be using them to sync blocks. - // For similar reasons, we don't return an error - we only close - // the connection if the peer is doing something wrong. + // For similar reasons, we don't want to fail_with() here - we + // only close the connection if the peer is doing something wrong. error!(%e, connection_state = ?self.state, client_receiver = ?self.client_rx,