mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
Error if address path mismatches manifest name
This commit is contained in:
parent
e871fd2bb1
commit
616c4c1c33
@ -433,8 +433,9 @@ class OrbitDB {
|
||||
logger.debug(`Manifest for '${dbAddress}':\n${JSON.stringify(manifest, null, 2)}`)
|
||||
|
||||
// Make sure the type from the manifest matches the type that was given as an option
|
||||
if (manifest.name !== dbAddress.path) { throw new Error(`Manifest '${manifest.name}' cannot be opened as '${dbAddress.path}'`) }
|
||||
if (options.type && manifest.type !== options.type) { throw new Error(`Database '${dbAddress}' is type '${manifest.type}' but was opened as '${options.type}'`) }
|
||||
|
||||
|
||||
// Save the database locally
|
||||
await this._addManifestToCache(options.cache, dbAddress)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user