mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-24 14:31:35 +00:00
fix: use libp2p.multiaddrs instead of listen
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
@ -32,7 +32,7 @@ class Circuit {
|
||||
this._connectionManager = libp2p.connectionManager
|
||||
this._upgrader = upgrader
|
||||
this._options = libp2p._config.relay
|
||||
this.addressManager = libp2p.addressManager
|
||||
this._libp2p = libp2p
|
||||
this.peerId = libp2p.peerId
|
||||
this._registrar.handle(multicodec, this._onProtocol.bind(this))
|
||||
}
|
||||
@ -122,7 +122,7 @@ class Circuit {
|
||||
type: CircuitPB.Type.HOP,
|
||||
srcPeer: {
|
||||
id: this.peerId.toBytes(),
|
||||
addrs: this.addressManager.getListenAddrs().map(addr => addr.buffer)
|
||||
addrs: this._libp2p.multiaddrs.map(addr => addr.buffer)
|
||||
},
|
||||
dstPeer: {
|
||||
id: destinationPeer.toBytes(),
|
||||
|
@ -189,8 +189,7 @@ class Libp2p extends EventEmitter {
|
||||
*/
|
||||
async start () {
|
||||
log('libp2p is starting')
|
||||
// TODO: consider validate listen addresses on start?
|
||||
// depend on transports?
|
||||
|
||||
try {
|
||||
await this._onStarting()
|
||||
await this._onDidStart()
|
||||
|
Reference in New Issue
Block a user