forked from cerc-io/plugeth
core: check genesis block before writeout
This commit is contained in:
parent
5001f778aa
commit
0c718afe90
@ -82,6 +82,10 @@ func WriteGenesisBlock(stateDb, blockDb common.Database, reader io.Reader) (*typ
|
||||
}, nil, nil, nil)
|
||||
block.Td = difficulty
|
||||
|
||||
if block := GetBlockByHash(blockDb, block.Hash()); block != nil {
|
||||
return nil, fmt.Errorf("Block %x already in database", block.Hash())
|
||||
}
|
||||
|
||||
statedb.Sync()
|
||||
|
||||
err = WriteBlock(blockDb, block)
|
||||
|
Loading…
Reference in New Issue
Block a user