mirror of https://codeberg.org/pzp/pzp-set.git
Fix minRequiredDepth() validation
This commit is contained in:
parent
0823473b18
commit
a2627e44ae
|
@ -454,9 +454,12 @@ function initSet(peer, config) {
|
||||||
const tangle = peer.db.getTangle(tangleID)
|
const tangle = peer.db.getTangle(tangleID)
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
if (!tangle || tangle.size === 0) throw new Error(`isGhostable() tangleID "${tangleID}" is empty`)
|
if (!tangle || tangle.size === 0) throw new Error(`Tangle "${tangleID}" is locally unknown`)
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
if (!isValidSetMoot(tangle.root)) throw new Error(`minRequiredDepth() "${tangleID}" is not a Set moot`)
|
if (!MsgV3.isMoot(tangle.root)) throw new Error(`Tangle "${tangleID}" is not a moot`)
|
||||||
|
const domain = tangle.root.metadata.domain
|
||||||
|
// prettier-ignore
|
||||||
|
if (!domain.startsWith(PREFIX)) throw new Error(`Tangle "${tangleID}" is not a Set moot`)
|
||||||
|
|
||||||
// Discover item roots
|
// Discover item roots
|
||||||
const itemRoots = new Set()
|
const itemRoots = new Set()
|
||||||
|
|
Loading…
Reference in New Issue