hypercore 11.35.1 → 11.35.2

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 CHANGED
@@ -978,7 +978,8 @@ class Peer {
978
978
  this.remoteOpened &&
979
979
  this.protomux.drained &&
980
980
  this.receiverQueue.length > 0 &&
981
- !this.removed
981
+ !this.removed &&
982
+ this.core.closing === null
982
983
  ) {
983
984
  const msg = this.receiverQueue.shift()
984
985
  await this._handleRequest(msg)
@@ -989,6 +990,7 @@ class Peer {
989
990
  }
990
991
 
991
992
  async push(index) {
993
+ if (this.core.closing !== null) return
992
994
  if (!this.remoteAllowPush) return
993
995
  if (!this.remoteDownloading) return
994
996
  if (this.core.state.length <= index) return
@@ -1269,7 +1271,7 @@ class Peer {
1269
1271
  return
1270
1272
  }
1271
1273
 
1272
- if (this.core.closed && !isCriticalError(err)) return
1274
+ if ((this.core.closing !== null || this.core.closed) && !isCriticalError(err)) return
1273
1275
 
1274
1276
  if (err.code !== 'INVALID_OPERATION') {
1275
1277
  // might be a fork, verify
@@ -1405,6 +1407,8 @@ class Peer {
1405
1407
  }
1406
1408
 
1407
1409
  async onrange({ drop, start, length }) {
1410
+ if (this.core.closing !== null) return
1411
+
1408
1412
  const has = drop === false
1409
1413
 
1410
1414
  if (drop === true && start < this._remoteContiguousLength) {
@@ -1956,6 +1960,7 @@ class Peer {
1956
1960
  }
1957
1961
  }
1958
1962
  } catch (err) {
1963
+ if (this.core.closing !== null) return
1959
1964
  this.stream.destroy(err)
1960
1965
  return
1961
1966
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.35.1",
3
+ "version": "11.35.2",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {