hypercore 10.28.2 → 10.28.4

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/batch.js CHANGED
@@ -91,7 +91,7 @@ module.exports = class HypercoreBatch extends EventEmitter {
91
91
  async has (index) {
92
92
  if (this.opened === false) await this.ready()
93
93
  if (index >= this._sessionLength) return index < this.length
94
- return this._session.has(index)
94
+ return this.session.has(index)
95
95
  }
96
96
 
97
97
  async update (opts) {
package/lib/core.js CHANGED
@@ -284,6 +284,7 @@ module.exports = class Core {
284
284
  }
285
285
 
286
286
  this.header.userData = src.header.userData.slice(0)
287
+ this.header.hints.contiguousLength = Math.min(src.header.hints.contiguousLength, this.header.tree.length)
287
288
 
288
289
  await this._flushOplog()
289
290
  } finally {
package/lib/replicator.js CHANGED
@@ -10,7 +10,7 @@ const caps = require('./caps')
10
10
 
11
11
  const DEFAULT_MAX_INFLIGHT = [32, 512]
12
12
  const SCALE_LATENCY = 50
13
- const DEFAULT_SEGMENT_SIZE = 128 * 1024 // 128 KiB
13
+ const DEFAULT_SEGMENT_SIZE = 256 * 1024 * 8 // 256 KiB in bits
14
14
 
15
15
  const PRIORITY = {
16
16
  NORMAL: 0,
@@ -403,7 +403,7 @@ class Peer {
403
403
 
404
404
  this.sendSync()
405
405
 
406
- const contig = this.core.header.contiguousLength
406
+ const contig = this.core.header.hints.contiguousLength
407
407
  if (contig > 0) {
408
408
  this.broadcastRange(0, contig, false)
409
409
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.28.2",
3
+ "version": "10.28.4",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {