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

Commit

Permalink
Merge branch 'dev-enhance-SolidLookAhead' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
alon-e committed Jun 4, 2017
2 parents 475347d + 0851d9c commit aedabb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/iota/iri/Milestone.java
Expand Up @@ -168,6 +168,7 @@ private boolean validateMilestone(TransactionViewModel transactionViewModel, int
void updateLatestSolidSubtangleMilestone() throws Exception {
MilestoneViewModel milestoneViewModel;
MilestoneViewModel latest = MilestoneViewModel.latest(tangle);
int lookAhead = 0;
if (latest != null) {
for (milestoneViewModel = MilestoneViewModel.findClosestNextMilestone(tangle, latestSolidSubtangleMilestoneIndex);
milestoneViewModel != null && milestoneViewModel.index() <= latest.index() && !shuttingDown;
Expand All @@ -178,7 +179,10 @@ void updateLatestSolidSubtangleMilestone() throws Exception {
latestSolidSubtangleMilestone = milestoneViewModel.getHash();
latestSolidSubtangleMilestoneIndex = milestoneViewModel.index();
} else {
break;
lookAhead++;
if (lookAhead>=10) {
break;
}
}
}
}
Expand Down

0 comments on commit aedabb8

Please sign in to comment.