diff --git a/beacon_node/eth2_libp2p/src/behaviour/mod.rs b/beacon_node/eth2_libp2p/src/behaviour/mod.rs index 716af9eb5..143b59f4f 100644 --- a/beacon_node/eth2_libp2p/src/behaviour/mod.rs +++ b/beacon_node/eth2_libp2p/src/behaviour/mod.rs @@ -828,9 +828,8 @@ impl NetworkBehaviour for Behaviour { // If the peer manager (and therefore the behaviour's) believe this peer connected, inform // about the disconnection. if self.network_globals.peers.read().is_connected(&peer_id) { - return; + delegate_to_behaviours!(self, inject_connection_closed, peer_id, conn_id, endpoint); } - delegate_to_behaviours!(self, inject_connection_closed, peer_id, conn_id, endpoint); } // This gets called once there are no more active connections. diff --git a/beacon_node/network/src/service.rs b/beacon_node/network/src/service.rs index a018750f3..1147562b4 100644 --- a/beacon_node/network/src/service.rs +++ b/beacon_node/network/src/service.rs @@ -306,7 +306,7 @@ fn spawn_service( service.libp2p.swarm.subscribe_to_subnet(subnet_id); } AttServiceMessage::Unsubscribe(subnet_id) => { - service.libp2p.swarm.subscribe_to_subnet(subnet_id); + service.libp2p.swarm.unsubscribe_from_subnet(subnet_id); } AttServiceMessage::EnrAdd(subnet_id) => { service.libp2p.swarm.update_enr_subnet(subnet_id, true);