mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-22 03:51:56 +00:00
Compare commits
1 Commits
v0.35.1
...
fix/do-not
Author | SHA1 | Date | |
---|---|---|---|
|
474d865d9f |
@@ -340,22 +340,22 @@ class ConnectionManager extends EventEmitter {
|
|||||||
return -1
|
return -1
|
||||||
})
|
})
|
||||||
|
|
||||||
for (let i = 0; i < peers.length && this.size < minConnections; i++) {
|
for (let i = 0; i < peers.length && this.size < minConnections && this._started; i++) {
|
||||||
if (!this.get(peers[i].id)) {
|
if (!this.get(peers[i].id)) {
|
||||||
log('connecting to a peerStore stored peer %s', peers[i].id.toB58String())
|
log('connecting to a peerStore stored peer %s', peers[i].id.toB58String())
|
||||||
try {
|
try {
|
||||||
await this._libp2p.dialer.connectToPeer(peers[i].id)
|
await this._libp2p.dialer.connectToPeer(peers[i].id)
|
||||||
|
|
||||||
// Connection Manager was stopped
|
|
||||||
if (!this._started) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} catch (/** @type {any} */ err) {
|
} catch (/** @type {any} */ err) {
|
||||||
log.error('could not connect to peerStore stored peer', err)
|
log.error('could not connect to peerStore stored peer', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Connection Manager was stopped
|
||||||
|
if (!this._started) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this._autoDialTimeout = retimer(this._autoDial, this._options.autoDialInterval)
|
this._autoDialTimeout = retimer(this._autoDial, this._options.autoDialInterval)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user