DataChannel -> StateChannel for Maj23Msg

This commit is contained in:
Ethan Buchman 2016-09-13 20:36:59 -04:00
parent 5f55ed2a40
commit c5a803a146
1 changed files with 5 additions and 5 deletions

View File

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