(cs *State, vote *types.Vote)
| 350 | } |
| 351 | |
| 352 | func defaultReceivePrecommit(cs *State, vote *types.Vote) { |
| 353 | height := cs.Height |
| 354 | precommits := cs.Votes.Precommits(vote.Round) |
| 355 | cs.Logger.Info("Added to precommit", "vote", vote, "precommits", precommits.StringShort()) |
| 356 | |
| 357 | blockID, ok := precommits.TwoThirdsMajority() |
| 358 | if ok { |
| 359 | // Executed as TwoThirdsMajority could be from a higher round |
| 360 | cs.enterNewRound(height, vote.Round) |
| 361 | cs.enterPrecommit(height, vote.Round) |
| 362 | if len(blockID.Hash) != 0 { |
| 363 | cs.enterCommit(height, vote.Round) |
| 364 | if cs.config.SkipTimeoutCommit && precommits.HasAll() { |
| 365 | cs.enterNewRound(cs.Height, 0) |
| 366 | } |
| 367 | } else { |
| 368 | cs.enterPrecommitWait(height, vote.Round) |
| 369 | } |
| 370 | } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() { |
| 371 | cs.enterNewRound(height, vote.Round) |
| 372 | cs.enterPrecommitWait(height, vote.Round) |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | func defaultReceiveProposal(cs *State, proposal *types.Proposal) error { |
| 377 | // Already have one |
no test coverage detected