Skip to content

Commit

Permalink
feat: add a comment for the getBestFinalCandidate method
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigorov-Georgi committed Jan 6, 2025
1 parent 15266ba commit 4d2550f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/limechain/grandpa/GrandpaService.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ public GrandpaService(RoundState roundState, BlockState blockState) {
this.blockState = blockState;
}

/**
* Finds and returns the best final candidate block for the current round.
* The best final candidate is determined by analyzing blocks with more than 2/3 pre-commit votes,
* and selecting the block with the highest block number. If no such block exists, the pre-voted
* block is returned as the best candidate.
*
* @return the best final candidate block
*/
public Vote getBestFinalCandidate() {

Vote preVoteCandidate = getGrandpaGhost();
Expand Down

0 comments on commit 4d2550f

Please sign in to comment.