(&mut self)
| 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) = |
no test coverage detected