diff --git a/package.json b/package.json index 6e86d93ce7..d273d0c419 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "libp2p-circuit": "~0.3.0", "libp2p-delegated-content-routing": "~0.2.2", "libp2p-delegated-peer-routing": "~0.2.2", - "libp2p-kad-dht": "~0.14.2", + "libp2p-kad-dht": "~0.14.5", "libp2p-mdns": "~0.12.0", "libp2p-mplex": "~0.8.4", "libp2p-secio": "~0.11.0", diff --git a/src/index.js b/src/index.js index 986e953281..cbbfbdc1da 100644 --- a/src/index.js +++ b/src/index.js @@ -404,7 +404,10 @@ class Node extends EventEmitter { // have to set started here because DHT requires libp2p is already started this._isStarted = true if (this._dht) { - this._dht.start(cb) + this._dht.start(() => { + this._dht.on('peer', (peerInfo) => this.emit('peer:discovery', peerInfo)) + cb() + }) } else { cb() }