hypercore 10.0.0-alpha.49 → 10.0.0-alpha.51
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/index.js +2 -2
- package/lib/replicator.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -664,8 +664,8 @@ module.exports = class Hypercore extends EventEmitter {
|
|
|
664
664
|
if (this.cache) this.cache.set(index, req)
|
|
665
665
|
} else {
|
|
666
666
|
if (opts && opts.wait === false) return null
|
|
667
|
-
if (opts && opts.onwait) opts.onwait(index)
|
|
668
|
-
else if (this.onwait) this.onwait(index)
|
|
667
|
+
if (opts && opts.onwait) opts.onwait(index, this)
|
|
668
|
+
else if (this.onwait) this.onwait(index, this)
|
|
669
669
|
|
|
670
670
|
const activeRequests = (opts && opts.activeRequests) || this.activeRequests
|
|
671
671
|
|
package/lib/replicator.js
CHANGED
|
@@ -1191,7 +1191,7 @@ module.exports = class Replicator {
|
|
|
1191
1191
|
for (let i = 0; i < this._ranges.length; i++) {
|
|
1192
1192
|
const r = this._ranges[i]
|
|
1193
1193
|
|
|
1194
|
-
while (r.start < r.end && this.core.bitfield.get(mapIndex(r.blocks, r.start)) === true) r.start++
|
|
1194
|
+
while ((r.end === -1 || r.start < r.end) && this.core.bitfield.get(mapIndex(r.blocks, r.start)) === true) r.start++
|
|
1195
1195
|
while (r.start < r.end && this.core.bitfield.get(mapIndex(r.blocks, r.end - 1)) === true) r.end--
|
|
1196
1196
|
|
|
1197
1197
|
if (r.end !== -1 && r.start >= r.end) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hypercore",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.51",
|
|
4
4
|
"description": "Hypercore 10",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"lib/**.js"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@hyperswarm/secret-stream": "^
|
|
35
|
+
"@hyperswarm/secret-stream": "^6.0.0",
|
|
36
36
|
"b4a": "^1.1.0",
|
|
37
37
|
"big-sparse-array": "^1.0.2",
|
|
38
38
|
"codecs": "^3.0.0",
|