corestore 7.0.14 → 7.0.15

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.
Files changed (2) hide show
  1. package/index.js +3 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -177,6 +177,8 @@ class CoreTracker {
177
177
 
178
178
  const all = []
179
179
  for (const core of this.map.values()) all.push(core.close())
180
+ this.map.clear()
181
+
180
182
  return Promise.all(all)
181
183
  }
182
184
 
@@ -351,6 +353,7 @@ class Corestore extends ReadyResource {
351
353
  async _attachMaybe (muxer, discoveryKey) {
352
354
  if (this.opened === false) await this.ready()
353
355
  if (this.cores.get(toHex(discoveryKey)) === null && !(await this.storage.has(discoveryKey, { ifMigrated: true }))) return
356
+ if (this.closing) return
354
357
 
355
358
  const core = this._openCore(discoveryKey, { createIfMissing: false })
356
359
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corestore",
3
- "version": "7.0.14",
3
+ "version": "7.0.15",
4
4
  "description": "A Hypercore factory that simplifies managing collections of cores.",
5
5
  "main": "index.js",
6
6
  "files": [