Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

fix: dont use peer ids in sets #165

Merged
merged 1 commit into from
Dec 12, 2019
Merged

fix: dont use peer ids in sets #165

merged 1 commit into from
Dec 12, 2019

Conversation

jacobheun
Copy link
Contributor

During queries, whenever a Peer is queried directly it is added to the peersSeen Set, which prevents us from querying them again. The issue is that currently peerSeen is a Set of PeerId. Whenever we learn about peers from the network, the deserialized PeerIds are created as new objects, which will cause them to be added to the set even if they belong to the same peer. This fixes that by using the string of the peer id and making peerSeen a string Set for better equality checking.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants