Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
Fixes first milestone doesn't have to be the first valid one
Browse files Browse the repository at this point in the history
  • Loading branch information
th0br0 committed Dec 2, 2017
1 parent 978efe5 commit f9fa79a
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public static MilestoneViewModel findClosestPrevMilestone(Tangle tangle, int ind
}

public static MilestoneViewModel findClosestNextMilestone(Tangle tangle, int index) throws Exception {
if(index <= com.iota.iri.Milestone.MILESTONE_START_INDEX) {
return first(tangle);
}
Pair<Indexable, Persistable> milestonePair = tangle.next(Milestone.class, new IntegerIndex(index));
if(milestonePair != null && milestonePair.hi != null) {
return new MilestoneViewModel((Milestone) milestonePair.hi);
Expand Down

0 comments on commit f9fa79a

Please sign in to comment.