hypercore-storage 1.0.9 → 1.0.10
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 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -346,11 +346,8 @@ class CorestoreStorage {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
// runs pre the core is returned to the user
|
|
349
|
-
async _migrateCore (core, discoveryKey, locked) {
|
|
349
|
+
async _migrateCore (core, discoveryKey, version, locked) {
|
|
350
350
|
const view = locked ? this.view : await this._enter()
|
|
351
|
-
|
|
352
|
-
const version = core.core.version
|
|
353
|
-
|
|
354
351
|
try {
|
|
355
352
|
if (version === VERSION) return
|
|
356
353
|
|
|
@@ -366,8 +363,6 @@ class CorestoreStorage {
|
|
|
366
363
|
}
|
|
367
364
|
}
|
|
368
365
|
|
|
369
|
-
core.core.version = VERSION
|
|
370
|
-
|
|
371
366
|
if (locked === false) return
|
|
372
367
|
|
|
373
368
|
// if its locked, then move the core state into the memview
|
|
@@ -605,7 +600,7 @@ class CorestoreStorage {
|
|
|
605
600
|
|
|
606
601
|
const result = new HypercoreStorage(this, this.db.session(), core, EMPTY, null)
|
|
607
602
|
|
|
608
|
-
if (version < VERSION) await this._migrateCore(result, discoveryKey, create)
|
|
603
|
+
if (version < VERSION) await this._migrateCore(result, discoveryKey, version, create)
|
|
609
604
|
return result
|
|
610
605
|
}
|
|
611
606
|
|