Skip to content

Commit

Permalink
ChainTip: add JavaDoc to findActiveChainTip
Browse files Browse the repository at this point in the history
  • Loading branch information
msgilligan committed Sep 26, 2023
1 parent 5e6b909 commit 624bc50
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public String getStatus() {
return status;
}

/**
* Find the active chain tip if there is one
* @param chainTips the list to search
* @return non-empty optional if active is found, empty optional if not found
*/
public static Optional<ChainTip> findActiveChainTip(List<ChainTip> chainTips) {
return chainTips.stream().filter(tip -> tip.getStatus().equals("active")).findFirst();
}
Expand Down

0 comments on commit 624bc50

Please sign in to comment.