mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: simplify condition
This commit is contained in:
parent
8a3508441a
commit
05b0941a0d
1 changed files with 1 additions and 7 deletions
|
|
@ -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 {
|
func (cm *chainMaker) makeHeader(parent *types.Block, state *state.StateDB, engine consensus.Engine) *types.Header {
|
||||||
var time uint64
|
time := parent.Time() + 10 // block time is fixed at 10 seconds
|
||||||
if parent.Time() == 0 {
|
|
||||||
time = 10
|
|
||||||
} else {
|
|
||||||
time = parent.Time() + 10 // block time is fixed at 10 seconds
|
|
||||||
}
|
|
||||||
|
|
||||||
header := &types.Header{
|
header := &types.Header{
|
||||||
Root: state.IntermediateRoot(cm.config.IsEIP158(parent.Number())),
|
Root: state.IntermediateRoot(cm.config.IsEIP158(parent.Number())),
|
||||||
ParentHash: parent.Hash(),
|
ParentHash: parent.Hash(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue