Skip to content

Commit

Permalink
Substituted lastRound with lastFinalizedRound in check if needed catc…
Browse files Browse the repository at this point in the history
…h-up peer.
  • Loading branch information
Hristiyan Mitov committed Jan 28, 2025
1 parent 6306ee6 commit a0f5ff1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ public CatchUpReqMessage initiateCatchUpRequestMessage(NeighbourMessage neighbou

// If peer has the same voter set id
if (neighbourMessage.getSetId().equals(setId)) {
BigInteger latestRound = roundCache.getLatestRoundNumber(setId);

// Check if needed to catch-up peer
if (neighbourMessage.getRound().compareTo(latestRound.add(CATCH_UP_THRESHOLD)) >= 0) {
if (neighbourMessage.getRound().compareTo(
lastFinalizedRound.getRoundNumber().add(CATCH_UP_THRESHOLD)) >= 0) {
log.log(Level.FINE, "Neighbor message indicates that the round of Peer " + peerId + " is ahead.");

catchUpReqMessage = CatchUpReqMessage.builder()
Expand Down

0 comments on commit a0f5ff1

Please sign in to comment.