Skip to content

Commit

Permalink
chore: remove _isStarted as it's no longer used
Browse files Browse the repository at this point in the history
_isStarted is an outdated property and shouldn't exist
in the code anymore. The state machine handles start
logic and the isStarted computed property pulls from there.
The code comments around dht and pubsub are also no
longer valid, so they were deleted.
  • Loading branch information
jacobheun committed Feb 5, 2019
1 parent dcf59a8 commit 558e598
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class Node extends EventEmitter {

this._modules = _options.modules
this._config = _options.config
this._isStarted = false
this._transport = [] // Transport instances/references
this._discovery = [] // Discovery service instances/references

Expand Down Expand Up @@ -400,18 +399,13 @@ class Node extends EventEmitter {
}
},
(cb) => {
// TODO: chicken-and-egg problem #1:
// have to set started here because DHT requires libp2p is already started
this._isStarted = true
if (this._dht) {
this._dht.start(cb)
} else {
cb()
}
},
(cb) => {
// TODO: chicken-and-egg problem #2:
// have to set started here because FloodSub requires libp2p is already started
if (this._floodSub) {
return this._floodSub.start(cb)
}
Expand Down

0 comments on commit 558e598

Please sign in to comment.