Fix BFT issue where VoteSetMaj23Message wasn't being sent where prs.Round == blockStore.Round()

This commit is contained in:
Jae Kwon
2016-09-15 17:55:07 -07:00
committed by Ethan Buchman
parent 3e3b034252
commit c1729addce
4 changed files with 18 additions and 10 deletions

View File

@ -637,9 +637,13 @@ OUTER_LOOP:
// Maybe send Height/CatchupCommitRound/CatchupCommit.
{
prs := ps.GetRoundState()
if prs.CatchupCommitRound != -1 && 1 < prs.Height && prs.Height <= conR.conS.blockStore.Height() {
log.Warn("uh", "CatchupCommitRound", prs.CatchupCommitRound, "prs.Height", prs.Height, "blockstoreHeight", conR.conS.blockStore.Height())
commit := conR.conS.blockStore.LoadBlockCommit(prs.Height)
if prs.CatchupCommitRound != -1 && 0 < prs.Height && prs.Height <= conR.conS.blockStore.Height() {
var commit *types.Commit
if prs.Height == conR.conS.blockStore.Height() {
commit = conR.conS.blockStore.LoadSeenCommit(prs.Height)
} else {
commit = conR.conS.blockStore.LoadBlockCommit(prs.Height)
}
peer.TrySend(StateChannel, struct{ ConsensusMessage }{&VoteSetMaj23Message{
Height: prs.Height,
Round: commit.Round(),