From 4051ba00e25cbdf82b395e919d0351ab8170b8be Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Fri, 21 Apr 2023 15:57:22 +0300 Subject: [PATCH] tiny refactor --- lib/algorithm.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/algorithm.js b/lib/algorithm.js index f3dfd13..3329fc3 100644 --- a/lib/algorithm.js +++ b/lib/algorithm.js @@ -31,9 +31,8 @@ class Algorithm { let minDepth = Number.MAX_SAFE_INTEGER let maxDepth = 0 for (const rec of this.#peer.db.records()) { - if (!rec.msg) continue + if (!rec.msg?.content) continue const tangles = rec.msg.metadata.tangles - if (!rec.msg.content) continue if (rec.hash === rootMsgHash) { minDepth = 0 } else if (tangles[rootMsgHash]) {