mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-05-08 17:02:14 +00:00
fix: await peer discovery start in libp2p start (#600)
This commit is contained in:
parent
da83721d6d
commit
bd7fd0f755
@ -399,7 +399,7 @@ class Libp2p extends EventEmitter {
|
|||||||
* Called when libp2p has started and before it returns
|
* Called when libp2p has started and before it returns
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_onDidStart () {
|
async _onDidStart () {
|
||||||
this._isStarted = true
|
this._isStarted = true
|
||||||
|
|
||||||
this.connectionManager.start()
|
this.connectionManager.start()
|
||||||
@ -410,7 +410,7 @@ class Libp2p extends EventEmitter {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Peer discovery
|
// Peer discovery
|
||||||
this._setupPeerDiscovery()
|
await this._setupPeerDiscovery()
|
||||||
|
|
||||||
// Once we start, emit and dial any peers we may have already discovered
|
// Once we start, emit and dial any peers we may have already discovered
|
||||||
for (const peerInfo of this.peerStore.peers.values()) {
|
for (const peerInfo of this.peerStore.peers.values()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user