corestore 6.8.0 → 6.8.1
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/index.js +2 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -191,7 +191,8 @@ module.exports = class Corestore extends ReadyResource {
|
|
|
191
191
|
const { discoveryKey, keyPair, auth } = await this._generateKeys(opts)
|
|
192
192
|
const id = b4a.toString(discoveryKey, 'hex')
|
|
193
193
|
|
|
194
|
-
const
|
|
194
|
+
const readonly = opts.writable === false || this._readonly
|
|
195
|
+
const rw = (opts && opts.exclusive && !readonly && keyPair) ? this._getLock(id) : null
|
|
195
196
|
|
|
196
197
|
if (rw) await rw.write.lock()
|
|
197
198
|
const release = () => {
|