diff --git a/core/genesis.go b/core/genesis.go index 7d3727b82..a88e88ea8 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -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)