mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: block may be nil in block.Hash()
This commit is contained in:
parent
25c3282cf1
commit
e2f36a4752
1 changed files with 5 additions and 1 deletions
|
|
@ -183,7 +183,11 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, constant
|
||||||
return genesis.Config, hash, &GenesisMismatchError{stored, hash}
|
return genesis.Config, hash, &GenesisMismatchError{stored, hash}
|
||||||
}
|
}
|
||||||
block, err := genesis.Commit(db)
|
block, err := genesis.Commit(db)
|
||||||
return genesis.Config, block.Hash(), err
|
var hash common.Hash
|
||||||
|
if block != nil {
|
||||||
|
hash = block.Hash()
|
||||||
|
}
|
||||||
|
return genesis.Config, hash, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the genesis block is already written.
|
// Check whether the genesis block is already written.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue