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

Commit

Permalink
chore: peer-discovery not using peer-info
Browse files Browse the repository at this point in the history
BREAKING CHANGE: peer event emitted with id and multiaddrs properties instead of peer-info
  • Loading branch information
vasco-santos committed Apr 6, 2020
1 parent 6456cc8 commit f5e99e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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 @@ -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)
}))
}
Expand Down

0 comments on commit f5e99e6

Please sign in to comment.