diff --git a/consensus/replay.go b/consensus/replay.go index abc43eb5..c9a779e3 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -276,7 +276,12 @@ func (h *Handshaker) ReplayBlocks( // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain. if appBlockHeight == 0 { - nextVals := types.TM2PB.ValidatorUpdates(state.NextValidators) // state.Validators would work too. + validators := make([]*types.Validator, len(h.genDoc.Validators)) + for i, val := range h.genDoc.Validators { + validators[i] = types.NewValidator(val.PubKey, val.Power) + } + validatorSet := types.NewValidatorSet(validators) + nextVals := types.TM2PB.ValidatorUpdates(validatorSet) csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams) req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime, diff --git a/types/part_set.go b/types/part_set.go index af59851c..a040258d 100644 --- a/types/part_set.go +++ b/types/part_set.go @@ -200,6 +200,9 @@ func (ps *PartSet) Total() int { } func (ps *PartSet) AddPart(part *Part) (bool, error) { + if ps == nil { + return false, nil + } ps.mtx.Lock() defer ps.mtx.Unlock()