Unverified Commit 8cacb422 authored by Guruprasad Kamath's avatar Guruprasad Kamath Committed by GitHub

core: verify genesis extradata for clique (#24470)

* Add extra-data checks for clique genesis

* Update genesis.go

* Update genesis.go

* core: simplify clique genesis check
Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
Co-authored-by: 's avatarMartin Holst Swende <martin@swende.se>
parent 9f75994b
......@@ -397,7 +397,7 @@ func (g *Genesis) Commit(db ethdb.Database) (*types.Block, error) {
if err := config.CheckConfigForkOrder(); err != nil {
return nil, err
}
if config.Clique != nil && len(block.Extra()) == 0 {
if config.Clique != nil && len(block.Extra()) < 32+crypto.SignatureLength {
return nil, errors.New("can't start clique chain without signers")
}
if err := g.Alloc.write(db, block.Hash()); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment