fix off-by-one in crossGoalWithTangle()

This commit is contained in:
Andre Staltz 2023-09-13 16:13:57 +03:00
parent 90fff89910
commit e129a47912
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 2 additions and 2 deletions

View File

@ -107,10 +107,10 @@ module.exports = {
case 'all': case 'all':
return [0, maxDepth] return [0, maxDepth]
case 'newest': case 'newest':
const start = Math.max(0, maxDepth - goal.count) const start = Math.max(0, maxDepth - goal.count + 1)
return [start, maxDepth] return [start, maxDepth]
case 'oldest': case 'oldest':
const end = Math.min(maxDepth, goal.count) const end = Math.min(maxDepth, goal.count - 1)
return [0, end] return [0, end]
} }
} }