Fix consensus: Send round-skip votes

This commit is contained in:
Jae Kwon
2015-06-26 17:07:19 -07:00
parent 6781b21d32
commit 9b00f32901
2 changed files with 13 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ WriteBinary(foo, buf, n, err)
foo2 := ReadBinary(Foo{}, buf, n, err).(Foo)
// Or, to decode onto a pointer:
foo2 := ReadBinary(&Foo{}, buf, n, err).(*Foo)
foo2 := ReadBinaryPtr(&Foo{}, buf, n, err).(*Foo)
```
WriteBinary and ReadBinary can encode/decode structs recursively. However, interface field

View File

@@ -520,6 +520,18 @@ OUTER_LOOP:
continue OUTER_LOOP
}
}
// If there are prevotes to send for the last round...
if rs.Round == prs.Round+1 && prs.Step <= RoundStepPrevote {
if trySendVote(rs.Votes.Prevotes(prs.Round), &prs.Prevotes) {
continue OUTER_LOOP
}
}
// If there are precommits to send for the last round...
if rs.Round == prs.Round+1 && prs.Step <= RoundStepPrecommit {
if trySendVote(rs.Votes.Precommits(prs.Round), &prs.Precommits) {
continue OUTER_LOOP
}
}
// If there are POLPrevotes to send...
if 0 <= prs.ProposalPOLRound {
if polPrevotes := rs.Votes.Prevotes(prs.ProposalPOLRound); polPrevotes != nil {