From e129a47912a99dd6c072e2eba69dbf119ae73180 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Wed, 13 Sep 2023 16:13:57 +0300 Subject: [PATCH] fix off-by-one in crossGoalWithTangle() --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 766c9b7..36e3750 100644 --- a/lib/index.js +++ b/lib/index.js @@ -107,10 +107,10 @@ module.exports = { case 'all': return [0, maxDepth] case 'newest': - const start = Math.max(0, maxDepth - goal.count) + const start = Math.max(0, maxDepth - goal.count + 1) return [start, maxDepth] case 'oldest': - const end = Math.min(maxDepth, goal.count) + const end = Math.min(maxDepth, goal.count - 1) return [0, end] } }