hypercore 10.28.7 → 10.28.8

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/lib/core.js +8 -0
  2. package/package.json +1 -1
package/lib/core.js CHANGED
@@ -222,6 +222,13 @@ module.exports = class Core {
222
222
  async copyFrom (src, signature, { length = src.tree.length } = {}) {
223
223
  await this._mutex.lock()
224
224
 
225
+ try {
226
+ await src._mutex.lock()
227
+ } catch (err) {
228
+ this._mutex.unlock()
229
+ throw err
230
+ }
231
+
225
232
  try {
226
233
  let pos = 0
227
234
 
@@ -290,6 +297,7 @@ module.exports = class Core {
290
297
 
291
298
  await this._flushOplog()
292
299
  } finally {
300
+ src._mutex.unlock()
293
301
  this._mutex.unlock()
294
302
  }
295
303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "10.28.7",
3
+ "version": "10.28.8",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {