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

Commit

Permalink
check starting til for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Alon Elmaliah committed Dec 1, 2017
1 parent ca68e14 commit 978efe5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/iota/iri/service/TipsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ Hash randomWalk(final Hash start, final Hash extraTip, final Map<Hash, Long> rat
messageQ.publish("rtsn %s", transactionViewModel.getHash());
break;
} else if (!transactionValidator.checkSolidity(transactionViewModel.getHash(), false)) {
//} else if (!transactionViewModel.isSolid()) {
log.info("Reason to stop: !checkSolidity");
messageQ.publish("rtss %s", transactionViewModel.getHash());
break;
Expand Down Expand Up @@ -255,6 +254,11 @@ Hash randomWalk(final Hash start, final Hash extraTip, final Map<Hash, Long> rat
}
log.info("Tx traversed to find tip: " + traversedTails);
messageQ.publish("mctn %d", traversedTails);

if (traversedTails == 0) {
throw new RuntimeException("starting tip failed consistency checks: " + tail.toString());
}

return tail;
}

Expand Down

0 comments on commit 978efe5

Please sign in to comment.