core: simplify condition

This commit is contained in:
Felix Lange 2023-10-31 10:23:52 +01:00
parent 8a3508441a
commit 05b0941a0d

View file

@ -403,13 +403,7 @@ func GenerateChainWithGenesis(genesis *Genesis, engine consensus.Engine, n int,
}
func (cm *chainMaker) makeHeader(parent *types.Block, state *state.StateDB, engine consensus.Engine) *types.Header {
var time uint64
if parent.Time() == 0 {
time = 10
} else {
time = parent.Time() + 10 // block time is fixed at 10 seconds
}
time := parent.Time() + 10 // block time is fixed at 10 seconds
header := &types.Header{
Root: state.IntermediateRoot(cm.config.IsEIP158(parent.Number())),
ParentHash: parent.Hash(),