BlockchainReactor syncs first before ConsensusReactor.

This commit is contained in:
Jae Kwon
2015-03-25 11:50:28 -07:00
parent aed4bbf0f0
commit cebfae60c7
9 changed files with 232 additions and 116 deletions
+2
View File
@@ -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
+2
View File
@@ -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
+1 -1
View File
@@ -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.")