Skip to content

Commit

Permalink
comment for if statement
Browse files Browse the repository at this point in the history
Co-authored-by: steviez <[email protected]>
  • Loading branch information
kubanemil and steviez authored Aug 1, 2024
1 parent 6049649 commit 0a878cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/verified_vote_packets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ impl VerifiedVotePackets {
let vote_packets = vote_packets_receiver.recv_timeout(RECV_TIMEOUT)?;
let vote_packets = std::iter::once(vote_packets).chain(vote_packets_receiver.try_iter());

// No need to process any votes if we will not be the leader soon. But,
// return early only after draining the channel to avoid accumulating
// votes that will be stale by the time we do become leader
if !would_be_leader {
return Ok(());
}
Expand Down

0 comments on commit 0a878cf

Please sign in to comment.