hypercore 11.0.38 → 11.0.40

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/lib/audit.js CHANGED
@@ -17,8 +17,8 @@ module.exports = async function auditCore (core, { tree = true, blocks = true, b
17
17
  for (const r of roots) {
18
18
  if (r === null) {
19
19
  if (!dryRun) {
20
- const ptr = core.storage.core
21
- await core.storage.store.deleteCore(ptr)
20
+ const storage = core.state.storage
21
+ await storage.store.deleteCore(storage.core)
22
22
  return null
23
23
  }
24
24
 
package/lib/core.js CHANGED
@@ -99,7 +99,7 @@ module.exports = class Core {
99
99
  }
100
100
 
101
101
  checkIfIdle () {
102
- if (this.destroyed === true || this.hasSession() === true) return
102
+ if (!this.opened || this.destroyed === true || this.hasSession() === true) return
103
103
  if (this.replicator.idle() === false) return
104
104
  if (this.state === null || this.state.mutex.idle() === false) return
105
105
  this.onidle()
@@ -123,6 +123,7 @@ module.exports = class Core {
123
123
  }
124
124
 
125
125
  this.opened = true
126
+ this.checkIfIdle()
126
127
  }
127
128
 
128
129
  async _tryOpen (opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.0.38",
3
+ "version": "11.0.40",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {