From 6707df0ee402ff0bcac0ed0753a48ad021e67ae4 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Tue, 16 Jan 2024 16:16:18 +0200 Subject: [PATCH] fix minRequiredDepth when tangle is unknown --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index fae001a..c0434bb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -352,7 +352,7 @@ function initDict(peer, config) { const tangle = peer.db.getTangle(tangleID) // prettier-ignore - if (!tangle || tangle.size === 0) throw new Error(`Tangle "${tangleID}" is locally unknown`) + if (!tangle || tangle.size === 0) return 0 // prettier-ignore if (!MsgV4.isMoot(tangle.root)) throw new Error(`Tangle "${tangleID}" is not a moot`) const domain = tangle.root.metadata.domain