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

Commit

Permalink
fix: random walk should not be started by kad-dht
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Sep 24, 2018
1 parent c69c1a3 commit 3f1abd9
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,7 @@ class KadDHT {
*/
start (callback) {
this._running = true
this.network.start((err) => {
if (err) {
return callback(err)
}
this.randomWalk.start()

callback()
})
this.network.start(callback)
}

/**
Expand All @@ -134,10 +127,8 @@ class KadDHT {
*/
stop (callback) {
this._running = false
this.randomWalk.stop(() => {
this.providers.stop()
this.network.stop(callback)
})
this.providers.stop()
this.network.stop(callback)
}

/**
Expand Down

0 comments on commit 3f1abd9

Please sign in to comment.