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

fix: false discovery #92

Merged
merged 2 commits into from
Mar 27, 2019
Merged

fix: false discovery #92

merged 2 commits into from
Mar 27, 2019

Conversation

alanshaw
Copy link
Member

This PR prevents the DHT claiming discovery of a peer that it may not have even discovered and also multiple discoveries of the same peer.

DHT was listening for 'peer-mux-established' from the switch and emitting a 'peer' event in response to it. Listening to 'peer-mux-established' implies that the peer has already been discovered so there's no need to emit it again and moreover the peer may not have been discovered by the DHT in the first place!

Alan Shaw added 2 commits March 27, 2019 11:34
This PR prevents the DHT claiming discovery of a peer that it may not have even discovered and also multiple discoveries of the same peer.

DHT was listening for 'peer-mux-established' from the switch and emitting a 'peer' event in response to it. Listening to 'peer-mux-established' implies that the peer has _already_ been discovered so there's no need to emit it again and moreover the peer may not have been discovered by the DHT in the first place!

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@ghost ghost assigned alanshaw Mar 27, 2019
@ghost ghost added the status/in-progress In progress label Mar 27, 2019
Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

This looks good!

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

@vasco-santos vasco-santos merged commit 466c992 into master Mar 27, 2019
@vasco-santos vasco-santos deleted the fix/false-discovery branch March 27, 2019 14:33
@ghost ghost removed the status/in-progress In progress label Mar 27, 2019
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.

3 participants