hypercore-storage 2.3.0 → 2.4.1
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 +6 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -956,7 +956,10 @@ class CorestoreStorage {
|
|
|
956
956
|
}
|
|
957
957
|
|
|
958
958
|
// not allowed to throw validation errors as its a shared tx!
|
|
959
|
-
async _create(
|
|
959
|
+
async _create(
|
|
960
|
+
view,
|
|
961
|
+
{ key, manifest, keyPair, encryptionKey, discoveryKey, alias, userData, core: ptrs }
|
|
962
|
+
) {
|
|
960
963
|
const rx = new CorestoreRX(this.db, view)
|
|
961
964
|
const tx = new CorestoreTX(view)
|
|
962
965
|
|
|
@@ -971,8 +974,8 @@ class CorestoreStorage {
|
|
|
971
974
|
if (head === null) head = initStoreHead()
|
|
972
975
|
if (head.defaultDiscoveryKey === null) head.defaultDiscoveryKey = discoveryKey
|
|
973
976
|
|
|
974
|
-
const corePointer = head.allocated.cores++
|
|
975
|
-
const dataPointer = head.allocated.datas++
|
|
977
|
+
const corePointer = ptrs ? ptrs.corePointer : head.allocated.cores++
|
|
978
|
+
const dataPointer = ptrs ? ptrs.dataPointer : head.allocated.datas++
|
|
976
979
|
|
|
977
980
|
core = { version: VERSION, corePointer, dataPointer, alias }
|
|
978
981
|
|