File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 7171 "libp2p-circuit" : " ~0.3.0" ,
7272 "libp2p-delegated-content-routing" : " ~0.2.2" ,
7373 "libp2p-delegated-peer-routing" : " ~0.2.2" ,
74- "libp2p-kad-dht" : " ~0.14.2 " ,
74+ "libp2p-kad-dht" : " libp2p/js-libp2p-kad-dht#feat/emit-event-on-peer-connected " ,
7575 "libp2p-mdns" : " ~0.12.0" ,
7676 "libp2p-mplex" : " ~0.8.4" ,
7777 "libp2p-secio" : " ~0.11.0" ,
Original file line number Diff line number Diff line change @@ -407,7 +407,10 @@ class Node extends EventEmitter {
407407 // have to set started here because DHT requires libp2p is already started
408408 this . _isStarted = true
409409 if ( this . _dht ) {
410- this . _dht . start ( cb )
410+ this . _dht . start ( ( ) => {
411+ this . _dht . on ( 'peer' , ( peerInfo ) => this . emit ( 'peer:discovery' , peerInfo ) )
412+ cb ( )
413+ } )
411414 } else {
412415 cb ( )
413416 }
You can’t perform that action at this time.
0 commit comments