good morning!!!!

Skip to content
Snippets Groups Projects
Commit 0c718afe authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

core: check genesis block before writeout

parent 5001f778
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment