|
@ -589,7 +589,7 @@ OUTER_LOOP: |
|
|
prs := ps.GetRoundState() |
|
|
prs := ps.GetRoundState() |
|
|
if rs.Height == prs.Height { |
|
|
if rs.Height == prs.Height { |
|
|
if maj23, ok := rs.Votes.Prevotes(prs.Round).TwoThirdsMajority(); ok { |
|
|
if maj23, ok := rs.Votes.Prevotes(prs.Round).TwoThirdsMajority(); ok { |
|
|
peer.TrySend(DataChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
|
|
|
|
|
|
peer.TrySend(StateChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
Height: prs.Height, |
|
|
Height: prs.Height, |
|
|
Round: prs.Round, |
|
|
Round: prs.Round, |
|
|
Type: types.VoteTypePrevote, |
|
|
Type: types.VoteTypePrevote, |
|
@ -608,7 +608,7 @@ OUTER_LOOP: |
|
|
prs := ps.GetRoundState() |
|
|
prs := ps.GetRoundState() |
|
|
if rs.Height == prs.Height { |
|
|
if rs.Height == prs.Height { |
|
|
if maj23, ok := rs.Votes.Precommits(prs.Round).TwoThirdsMajority(); ok { |
|
|
if maj23, ok := rs.Votes.Precommits(prs.Round).TwoThirdsMajority(); ok { |
|
|
peer.TrySend(DataChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
|
|
|
|
|
|
peer.TrySend(StateChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
Height: prs.Height, |
|
|
Height: prs.Height, |
|
|
Round: prs.Round, |
|
|
Round: prs.Round, |
|
|
Type: types.VoteTypePrecommit, |
|
|
Type: types.VoteTypePrecommit, |
|
@ -625,7 +625,7 @@ OUTER_LOOP: |
|
|
prs := ps.GetRoundState() |
|
|
prs := ps.GetRoundState() |
|
|
if rs.Height == prs.Height && prs.ProposalPOLRound >= 0 { |
|
|
if rs.Height == prs.Height && prs.ProposalPOLRound >= 0 { |
|
|
if maj23, ok := rs.Votes.Prevotes(prs.ProposalPOLRound).TwoThirdsMajority(); ok { |
|
|
if maj23, ok := rs.Votes.Prevotes(prs.ProposalPOLRound).TwoThirdsMajority(); ok { |
|
|
peer.TrySend(DataChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
|
|
|
|
|
|
peer.TrySend(StateChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
Height: prs.Height, |
|
|
Height: prs.Height, |
|
|
Round: prs.ProposalPOLRound, |
|
|
Round: prs.ProposalPOLRound, |
|
|
Type: types.VoteTypePrevote, |
|
|
Type: types.VoteTypePrevote, |
|
@ -642,9 +642,9 @@ OUTER_LOOP: |
|
|
// Maybe send Height/CatchupCommitRound/CatchupCommit.
|
|
|
// Maybe send Height/CatchupCommitRound/CatchupCommit.
|
|
|
{ |
|
|
{ |
|
|
prs := ps.GetRoundState() |
|
|
prs := ps.GetRoundState() |
|
|
if prs.CatchupCommitRound != -1 { |
|
|
|
|
|
|
|
|
if prs.CatchupCommitRound != -1 && prs.Height <= conR.blockStore.Height() { |
|
|
commit := conR.blockStore.LoadBlockCommit(prs.Height) |
|
|
commit := conR.blockStore.LoadBlockCommit(prs.Height) |
|
|
peer.TrySend(DataChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
|
|
|
|
|
|
peer.TrySend(StateChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{ |
|
|
Height: prs.Height, |
|
|
Height: prs.Height, |
|
|
Round: commit.Round(), |
|
|
Round: commit.Round(), |
|
|
Type: types.VoteTypePrecommit, |
|
|
Type: types.VoteTypePrecommit, |
|
|