Browse Source

use validation round in reconstructLastCommit

pull/172/head
Ethan Buchman 9 years ago
parent
commit
c0c2a4b968
2 changed files with 5 additions and 4 deletions
  1. +2
    -2
      consensus/replay.go
  2. +3
    -2
      consensus/state.go

+ 2
- 2
consensus/replay.go View File

@ -10,8 +10,8 @@ import (
"strings"
"time"
. "github.com/tendermint/tendermint/Godeps/_workspace/src/github.com/tendermint/go-common"
"github.com/tendermint/tendermint/Godeps/_workspace/src/github.com/tendermint/go-wire"
. "github.com/tendermint/go-common"
"github.com/tendermint/go-wire"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"


+ 3
- 2
consensus/state.go View File

@ -378,8 +378,8 @@ func (cs *ConsensusState) reconstructLastCommit(state *sm.State) {
if state.LastBlockHeight == 0 {
return
}
lastPrecommits := types.NewVoteSet(state.LastBlockHeight, 0, types.VoteTypePrecommit, state.LastValidators)
seenValidation := cs.blockStore.LoadSeenValidation(state.LastBlockHeight)
lastPrecommits := types.NewVoteSet(state.LastBlockHeight, seenValidation.Round(), types.VoteTypePrecommit, state.LastValidators)
for idx, precommit := range seenValidation.Precommits {
if precommit == nil {
continue
@ -1258,7 +1258,8 @@ func (cs *ConsensusState) addProposalBlockPart(height int, part *types.Part) (ad
var n int
var err error
cs.ProposalBlock = wire.ReadBinary(&types.Block{}, cs.ProposalBlockParts.GetReader(), types.MaxBlockSize, &n, &err).(*types.Block)
log.Info("Received complete proposal", "height", cs.ProposalBlock.Height, "hash", cs.ProposalBlock.Hash())
// NOTE: it's possible to receive complete proposal blocks for future rounds without having the proposal
log.Info("Received complete proposal block", "height", cs.ProposalBlock.Height, "hash", cs.ProposalBlock.Hash())
if cs.Step == RoundStepPropose && cs.isProposalComplete() {
// Move onto the next step
cs.enterPrevote(height, cs.Round)


Loading…
Cancel
Save