Skip to content

Commit

Permalink
Made runnable inline and added logger when finalizedBlock not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hristiyan Mitov committed Feb 7, 2025
1 parent 816ca38 commit f5828fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/limechain/grandpa/round/FinalizeStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ public void start(GrandpaRound round) {
return;
}

Runnable onFinalizeHandler = () -> {
round.setOnFinalizeHandler(() -> {
if (isRoundReadyToBeFinalized(round)) {
end(round);
}
};
round.setOnFinalizeHandler(onFinalizeHandler);
});
}

@Override
Expand All @@ -40,6 +39,7 @@ private boolean isRoundReadyToBeFinalized(GrandpaRound round) {
try {
finalized = round.getFinalizedBlock();
} catch (GrandpaGenericException e) {
log.warning("Finalized block not found, round cannot be finalized.");
return false;
}

Expand Down

0 comments on commit f5828fb

Please sign in to comment.