Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

chore: peer-discovery not using peer-info #180

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------
Expand Down
2 changes: 1 addition & 1 deletion src/query/workerQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class WorkerQueue {
if (this.dht._isSelf(closer.id)) {
return
}
this.dht._peerDiscovered(closer)
this.dht._peerDiscovered(closer.id, closer.multiaddrs.toArray())
await this.path.addPeerToQuery(closer.id)
}))
}
Expand Down