From 624bc5078307e55dcd1a3b785568d9fb9b83e104 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Tue, 26 Sep 2023 12:21:53 -0700 Subject: [PATCH] ChainTip: add JavaDoc to findActiveChainTip --- .../main/java/org/consensusj/bitcoin/json/pojo/ChainTip.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cj-btc-json/src/main/java/org/consensusj/bitcoin/json/pojo/ChainTip.java b/cj-btc-json/src/main/java/org/consensusj/bitcoin/json/pojo/ChainTip.java index cc892dd7c..2bdbc3489 100644 --- a/cj-btc-json/src/main/java/org/consensusj/bitcoin/json/pojo/ChainTip.java +++ b/cj-btc-json/src/main/java/org/consensusj/bitcoin/json/pojo/ChainTip.java @@ -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 findActiveChainTip(List chainTips) { return chainTips.stream().filter(tip -> tip.getStatus().equals("active")).findFirst(); }