consensus: fix panic on POLRound=-1

This commit is contained in:
Ethan Buchman 2016-09-13 16:24:31 -04:00
parent 57da2e4af5
commit 7afcf92539

View File

@ -623,7 +623,7 @@ OUTER_LOOP:
{ {
rs := conR.conS.GetRoundState() rs := conR.conS.GetRoundState()
prs := ps.GetRoundState() prs := ps.GetRoundState()
if rs.Height == prs.Height { 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(DataChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{
Height: prs.Height, Height: prs.Height,