allow genesisTime IsZero -> now
This commit is contained in:
parent
647d26f7a0
commit
47caa47076
|
@ -293,7 +293,9 @@ func (conR *ConsensusReactor) stepTransitionRoutine() {
|
|||
// when it is due.
|
||||
scheduleNextAction := func() {
|
||||
rs := conR.conS.GetRoundState()
|
||||
_, _, roundDuration, _, elapsedRatio := calcRoundInfo(rs.StartTime)
|
||||
round, roundStartTime, roundDuration, _, elapsedRatio := calcRoundInfo(rs.StartTime)
|
||||
log.Debug("Called scheduleNextAction. round:%v roundStartTime:%v elapsedRatio:%v",
|
||||
round, roundStartTime, elapsedRatio)
|
||||
go func() {
|
||||
switch rs.Step {
|
||||
case RoundStepStart:
|
||||
|
|
|
@ -39,6 +39,10 @@ func GenesisStateFromDoc(db db_.DB, genDoc *GenesisDoc) *State {
|
|||
|
||||
func GenesisState(db db_.DB, genesisTime time.Time, accDets []*AccountDetail) *State {
|
||||
|
||||
if genesisTime.IsZero() {
|
||||
genesisTime = time.Now()
|
||||
}
|
||||
|
||||
// TODO: Use "uint64Codec" instead of BasicCodec
|
||||
accountDetails := merkle.NewIAVLTree(BasicCodec, AccountDetailCodec, defaultAccountDetailsCacheCapacity, db)
|
||||
validators := []*Validator{}
|
||||
|
|
Loading…
Reference in New Issue