chore: remove _isStarted as it's no longer used

_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.
This commit is contained in:
Jacob Heun 2019-02-05 15:26:55 +01:00
parent dcf59a8468
commit 558e5987be

View File

@ -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
@ -400,9 +399,6 @@ 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 {
@ -410,8 +406,6 @@ class Node extends EventEmitter {
}
},
(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)
}