diff --git a/src/index.js b/src/index.js index 51d08f61..29a59155 100644 --- a/src/index.js +++ b/src/index.js @@ -305,8 +305,11 @@ class KadDHT extends EventEmitter { // ----------- Discovery ----------- - _peerDiscovered (peerInfo) { - this.emit('peer', peerInfo) + _peerDiscovered (peerId, multiaddrs) { + this.emit('peer', { + id: peerId, + multiaddrs + }) } // ----------- Internals ----------- diff --git a/src/query/workerQueue.js b/src/query/workerQueue.js index 7bd11450..f319dbff 100644 --- a/src/query/workerQueue.js +++ b/src/query/workerQueue.js @@ -245,7 +245,7 @@ class WorkerQueue { return } closer = this.dht.peerStore.put(closer) - this.dht._peerDiscovered(closer) + this.dht._peerDiscovered(closer.id, closer.multiaddrs.toArray()) await this.path.addPeerToQuery(closer.id) })) }