corestore 6.18.0 → 6.18.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/index.js +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -309,6 +309,7 @@ module.exports = class Corestore extends ReadyResource {
|
|
|
309
309
|
const core = new Hypercore(p => this.storage(storageRoot + '/' + p), {
|
|
310
310
|
_preready: this._preready.bind(this),
|
|
311
311
|
notDownloadingLinger: this._notDownloadingLinger,
|
|
312
|
+
inflightRange: this.inflightRange,
|
|
312
313
|
autoClose: true,
|
|
313
314
|
active: false,
|
|
314
315
|
encryptionKey: opts.encryptionKey || null,
|
|
@@ -385,9 +386,6 @@ module.exports = class Corestore extends ReadyResource {
|
|
|
385
386
|
if (this._readonly && opts.writable !== false) {
|
|
386
387
|
opts.writable = false
|
|
387
388
|
}
|
|
388
|
-
if (!opts.inflightRange && this.inflightRange) {
|
|
389
|
-
opts.inflightRange = this.inflightRange
|
|
390
|
-
}
|
|
391
389
|
|
|
392
390
|
let rw = null
|
|
393
391
|
let id = null
|
|
@@ -456,11 +454,14 @@ module.exports = class Corestore extends ReadyResource {
|
|
|
456
454
|
})
|
|
457
455
|
|
|
458
456
|
if (!this.passive) {
|
|
457
|
+
const muxer = stream.noiseStream.userData
|
|
458
|
+
muxer.cork()
|
|
459
459
|
for (const core of this.cores.values()) {
|
|
460
460
|
// If the core is not opened, it will be replicated in preload.
|
|
461
461
|
if (!core.opened || core.closing || !core.replicator.downloading) continue
|
|
462
462
|
core.replicate(stream, { session: true })
|
|
463
463
|
}
|
|
464
|
+
stream.noiseStream.opened.then(() => muxer.uncork())
|
|
464
465
|
}
|
|
465
466
|
|
|
466
467
|
const streamRecord = { stream, isExternal }
|