diff --git a/libp2p/network/swarm.py b/libp2p/network/swarm.py index a697d7da..7bb40cee 100644 --- a/libp2p/network/swarm.py +++ b/libp2p/network/swarm.py @@ -248,8 +248,8 @@ class Swarm(INetwork): # TODO: Should be changed to close multisple connections, # if we have several connections per peer in the future. connection = self.connections[peer_id] - # NOTE: `connection.close` performs `del self.connections[peer_id]` for us, - # so we don't need to remove the entry here. + # NOTE: `connection.close` will perform `del self.connections[peer_id]` + # and `notify_disconnected` for us. await connection.close() logger.debug("successfully close the connection to peer %s", peer_id)