Skip to content

Commit

Permalink
fix: await peer discovery start in libp2p start (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Apr 6, 2020
1 parent da83721 commit bd7fd0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class Libp2p extends EventEmitter {
* Called when libp2p has started and before it returns
* @private
*/
_onDidStart () {
async _onDidStart () {
this._isStarted = true

this.connectionManager.start()
Expand All @@ -410,7 +410,7 @@ class Libp2p extends EventEmitter {
})

// Peer discovery
this._setupPeerDiscovery()
await this._setupPeerDiscovery()

// Once we start, emit and dial any peers we may have already discovered
for (const peerInfo of this.peerStore.peers.values()) {
Expand Down

0 comments on commit bd7fd0f

Please sign in to comment.