diff --git a/network/src/network.rs b/network/src/network.rs index 6aec09d62a..9acc913b3f 100644 --- a/network/src/network.rs +++ b/network/src/network.rs @@ -717,13 +717,11 @@ impl ServiceHandle for EventHandler { "registry peer failed {:?} disconnect it, {} => {}", err, session_context.id, session_context.address, ); - if let Err(err) = async_disconnect_with_message( - context.control(), + if let Err(err) = disconnect_with_message( + &control, session_context.id, "reject peer connection", - ) - .await - { + ) { debug!( "Disconnect failed {:?}, error: {:?}", session_context.id, err