diff --git a/substrate/client/network/src/behaviour.rs b/substrate/client/network/src/behaviour.rs index 171acc9562..5a5dd83803 100644 --- a/substrate/client/network/src/behaviour.rs +++ b/substrate/client/network/src/behaviour.rs @@ -320,19 +320,10 @@ impl NetworkBehaviourEventProcess { - // There doesn't exist any mechanism to report cancellations yet. - // We would normally disconnect the node, but this event happens as the result of - // a disconnect, so there's nothing more to do. - self.events.push_back(BehaviourOut::RequestFinished { - peer, - protocol: self.block_requests.protocol_name().to_vec(), - request_duration, - }); - } + block_requests::Event::RequestCancelled { peer, request_duration, .. } | block_requests::Event::RequestTimeout { peer, request_duration, .. } => { - // There doesn't exist any mechanism to report timeouts yet, so we process them by - // disconnecting the node. + // There doesn't exist any mechanism to report cancellations or timeouts yet, so + // we process them by disconnecting the node. self.events.push_back(BehaviourOut::RequestFinished { peer: peer.clone(), protocol: self.block_requests.protocol_name().to_vec(),