Minor cleanup:

- remove outdated comment
- add new peer at the end
- turn peers to send from list to set
This commit is contained in:
NIC619
2019-12-17 17:17:03 +08:00
parent ef31f7f6d6
commit 7d6daa8e10
3 changed files with 8 additions and 12 deletions

View File

@ -148,11 +148,9 @@ class GossipSub(IPubsubRouter):
for topic in self.mesh:
if peer_id in self.mesh[topic]:
# Delete the entry if no other peers left
self.mesh[topic].remove(peer_id)
for topic in self.fanout:
if peer_id in self.fanout[topic]:
# Delete the entry if no other peers left
self.fanout[topic].remove(peer_id)
self.peers_to_protocol.pop(peer_id, None)