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.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. 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 rw = (opts && opts.exclusive && opts.writable !== false && keyPair) ? this._getLock(id) : null
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 = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corestore",
3
- "version": "6.8.0",
3
+ "version": "6.8.1",
4
4
  "description": "A Hypercore factory that simplifies managing collections of cores.",
5
5
  "main": "index.js",
6
6
  "scripts": {