MCPcopy Create free account
hub / github.com/cryptape/bft-rs / transmit_precommit

Method transmit_precommit

src/algorithm.rs:680–710  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

678 }
679
680 fn transmit_precommit(&mut self) {
681 let precommit = if let Some(lock_proposal) = self.lock_status.clone() {
682 lock_proposal.proposal
683 } else {
684 self.proposal = None;
685 Vec::new()
686 };
687
688 trace!(
689 "Transmit precommit at height {:?}, round {:?}",
690 self.height,
691 self.round
692 );
693
694 let vote = Vote {
695 vote_type: VoteType::Precommit,
696 height: self.height,
697 round: self.round,
698 proposal: precommit.clone(),
699 voter: self.params.address.clone(),
700 };
701
702 let _ = self.votes.add(vote.clone());
703 let msg = BftMsg::Vote(vote);
704 debug!("Precommit to {:?}", precommit);
705 self.send_bft_msg(msg);
706 self.set_timer(
707 self.params.timer.get_precommit() * TIMEOUT_RETRANSE_COEF,
708 Step::Precommit,
709 );
710 }
711
712 fn check_precommit_count(&mut self) -> i8 {
713 if let Some(precommit_set) =

Callers 2

processMethod · 0.80
timeout_processMethod · 0.80

Calls 5

VoteClass · 0.85
addMethod · 0.80
send_bft_msgMethod · 0.80
set_timerMethod · 0.80
get_precommitMethod · 0.80

Tested by

no test coverage detected