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.
- package/lib/core.js +8 -0
- 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
|
}
|