hypercore 10.37.23 → 10.37.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/replicator.js +3 -2
- package/package.json +1 -1
package/lib/replicator.js
CHANGED
|
@@ -2327,9 +2327,10 @@ module.exports = class Replicator {
|
|
|
2327
2327
|
clearTimeout(this._downloadingTimer)
|
|
2328
2328
|
this._downloadingTimer = null
|
|
2329
2329
|
}
|
|
2330
|
-
|
|
2330
|
+
while (this.peers.length) {
|
|
2331
|
+
const peer = this.peers[this.peers.length - 1]
|
|
2331
2332
|
this.detachFrom(peer.protomux)
|
|
2332
|
-
peer.channel.close()
|
|
2333
|
+
peer.channel.close() // peer is removed from array in onclose
|
|
2333
2334
|
}
|
|
2334
2335
|
for (const protomux of this._attached) {
|
|
2335
2336
|
this.detachFrom(protomux)
|