Networking bug fixes (#1684)
* call correct unsubscribe method for subnets * correctly delegate closed connections in behaviour * correct unsubscribe method name
This commit is contained in:
parent
6c1d7f55bf
commit
ae28773965
@ -828,10 +828,9 @@ impl<TSpec: EthSpec> NetworkBehaviour for Behaviour<TSpec> {
|
|||||||
// If the peer manager (and therefore the behaviour's) believe this peer connected, inform
|
// If the peer manager (and therefore the behaviour's) believe this peer connected, inform
|
||||||
// about the disconnection.
|
// about the disconnection.
|
||||||
if self.network_globals.peers.read().is_connected(&peer_id) {
|
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.
|
// This gets called once there are no more active connections.
|
||||||
fn inject_disconnected(&mut self, peer_id: &PeerId) {
|
fn inject_disconnected(&mut self, peer_id: &PeerId) {
|
||||||
|
@ -306,7 +306,7 @@ fn spawn_service<T: BeaconChainTypes>(
|
|||||||
service.libp2p.swarm.subscribe_to_subnet(subnet_id);
|
service.libp2p.swarm.subscribe_to_subnet(subnet_id);
|
||||||
}
|
}
|
||||||
AttServiceMessage::Unsubscribe(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) => {
|
AttServiceMessage::EnrAdd(subnet_id) => {
|
||||||
service.libp2p.swarm.update_enr_subnet(subnet_id, true);
|
service.libp2p.swarm.update_enr_subnet(subnet_id, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user