mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
BlockchainReactor syncs first before ConsensusReactor.
This commit is contained in:
@@ -29,6 +29,8 @@ const (
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The reactor's underlying ConsensusState may change state at any time.
|
||||
// We atomically copy the RoundState struct before using it.
|
||||
type ConsensusReactor struct {
|
||||
sw *p2p.Switch
|
||||
started uint32
|
||||
|
||||
@@ -467,6 +467,8 @@ func (cs *ConsensusState) updateToState(state *sm.State) {
|
||||
// Reset fields based on state.
|
||||
validators := state.BondedValidators
|
||||
height := state.LastBlockHeight + 1 // next desired block height
|
||||
|
||||
// RoundState fields
|
||||
cs.Height = height
|
||||
cs.Round = 0
|
||||
cs.Step = RoundStepNewHeight
|
||||
|
||||
@@ -34,7 +34,7 @@ type VoteSet struct {
|
||||
maj23Exists bool
|
||||
}
|
||||
|
||||
// Constructs a new VoteSet struct used to accumulate votes for each round.
|
||||
// Constructs a new VoteSet struct used to accumulate votes for given height/round.
|
||||
func NewVoteSet(height uint, round uint, type_ byte, valSet *sm.ValidatorSet) *VoteSet {
|
||||
if height == 0 {
|
||||
panic("Cannot make VoteSet for height == 0, doesn't make sense.")
|
||||
|
||||
Reference in New Issue
Block a user