mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-16 09:01:58 +00:00
Compare commits
1 Commits
v0.37.0
...
fix/do-not
Author | SHA1 | Date | |
---|---|---|---|
|
474d865d9f |
@@ -340,22 +340,22 @@ class ConnectionManager extends EventEmitter {
|
||||
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)) {
|
||||
log('connecting to a peerStore stored peer %s', peers[i].id.toB58String())
|
||||
try {
|
||||
await this._libp2p.dialer.connectToPeer(peers[i].id)
|
||||
|
||||
// Connection Manager was stopped
|
||||
if (!this._started) {
|
||||
return
|
||||
}
|
||||
} catch (/** @type {any} */ 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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user