diff --git a/beacon_node/eth2_libp2p/src/rpc/protocol.rs b/beacon_node/eth2_libp2p/src/rpc/protocol.rs index 58ef95460..5fe5afe8e 100644 --- a/beacon_node/eth2_libp2p/src/rpc/protocol.rs +++ b/beacon_node/eth2_libp2p/src/rpc/protocol.rs @@ -395,7 +395,11 @@ where let mut socket = Framed::new(socket, codec); - let future = async { socket.send(self).await.map(|_| socket) }; + let future = async { + socket.send(self).await?; + socket.close().await?; + Ok(socket) + }; Box::pin(future) } }