hypercore 11.10.0 → 11.11.0

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/multisig.js CHANGED
@@ -37,7 +37,13 @@ async function partialSignature (core, signer, from, to = core.state.length, sig
37
37
 
38
38
  async function upgradeNodes (core, from, to) {
39
39
  const rx = core.state.storage.read()
40
- const p = await MerkleTree.proof(core.state, rx, { upgrade: { start: from, length: to - from } })
40
+ let p = null
41
+ try {
42
+ p = await MerkleTree.proof(core.state, rx, { upgrade: { start: from, length: to - from } })
43
+ } catch (err) {
44
+ rx.destroy()
45
+ throw err
46
+ }
41
47
  rx.tryFlush()
42
48
  return (await p.settle()).upgrade.nodes
43
49
  }
package/lib/streams.js CHANGED
@@ -9,6 +9,8 @@ class ReadStream extends Readable {
9
9
  this.end = typeof opts.end === 'number' ? opts.end : -1
10
10
  this.snapshot = !opts.live && opts.snapshot !== false
11
11
  this.live = this.end === -1 ? !!opts.live : false
12
+ this.wait = typeof opts.wait === 'boolean' ? opts.wait : this.core.wait
13
+ this.timeout = opts.timeout || core.timeout
12
14
  }
13
15
 
14
16
  _open (cb) {
@@ -32,7 +34,7 @@ class ReadStream extends Readable {
32
34
  return
33
35
  }
34
36
 
35
- this.push(await this.core.get(this.start++))
37
+ this.push(await this.core.get(this.start++, { wait: this.wait, timeout: this.timeout }))
36
38
  }
37
39
  }
38
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.10.0",
3
+ "version": "11.11.0",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {