PR feedback: Add check in Swarm.close_peer
This commit is contained in:
parent
9e8a6bdf29
commit
aa0866698f
|
@ -279,6 +279,8 @@ class Swarm(INetwork):
|
|||
)
|
||||
|
||||
async def close_peer(self, peer_id: ID) -> None:
|
||||
if peer_id not in self.connections:
|
||||
return
|
||||
connection = self.connections[peer_id]
|
||||
del self.connections[peer_id]
|
||||
await connection.close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user