fix: emit peer discovery for dht discovery

This commit is contained in:
Vasco Santos
2018-12-28 10:54:56 +00:00
committed by Jacob Heun
parent 558e5987be
commit 9e7a080a5c
3 changed files with 50 additions and 2 deletions

View File

@ -400,7 +400,10 @@ class Node extends EventEmitter {
},
(cb) => {
if (this._dht) {
this._dht.start(cb)
this._dht.start(() => {
this._dht.on('peer', (peerInfo) => this.emit('peer:discovery', peerInfo))
cb()
})
} else {
cb()
}