Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove unneeded peerbook puts #348

Merged
merged 6 commits into from
Apr 5, 2019
Merged

fix: remove unneeded peerbook puts #348

merged 6 commits into from
Apr 5, 2019

Conversation

jacobheun
Copy link
Contributor

@jacobheun jacobheun commented Apr 4, 2019

With libp2p/js-libp2p-kad-dht#92 the dht test for peer discovery was out of date. I fixed it and updated the other tests to use lower intervals so we dont have to wait 10seconds for discovery to happen.

The circuit tests were also inaccurate so those were fixed.

Switch had a significant number of code added recently, so the bundle size threshold needed to be increased slightly.

@ghost ghost assigned jacobheun Apr 4, 2019
@ghost ghost added the status/in-progress In progress label Apr 4, 2019
@jacobheun jacobheun marked this pull request as ready for review April 4, 2019 17:45
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!

I just requested a minor change to pass the callback immediately, instead of having a function to call it. After you change that, and this is good to go.

src/index.js Outdated
@@ -246,7 +245,6 @@ class Node extends EventEmitter {

this._switch.dial(peerInfo, protocol, (err, conn) => {
Copy link
Member

Choose a reason for hiding this comment

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

We can just pass the callback now. Lines below have to be removed

Suggested change
this._switch.dial(peerInfo, protocol, (err, conn) => {
this._switch.dial(peerInfo, protocol, callback)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, good call! I've updated those.

src/index.js Outdated
@@ -275,9 +273,6 @@ class Node extends EventEmitter {
if (err) { return callback(err) }

this._switch.dialFSM(peerInfo, protocol, (err, connFSM) => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this._switch.dialFSM(peerInfo, protocol, (err, connFSM) => {
this._switch.dialFSM(peerInfo, protocol, callback)

@jacobheun jacobheun merged commit e5f19e8 into master Apr 5, 2019
@ghost ghost removed the status/in-progress In progress label Apr 5, 2019
@jacobheun jacobheun deleted the fix/remove-put branch April 5, 2019 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants