Skip to content

Commit

Permalink
consensus/misc: not checking extra data on metadium mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
sadoci committed Nov 23, 2021
1 parent 98bc33d commit edb77d5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions consensus/misc/dao.go
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
metaminer "github.com/ethereum/go-ethereum/metadium/miner"
"github.com/ethereum/go-ethereum/params"
)

Expand Down Expand Up @@ -55,13 +56,15 @@ func VerifyDAOHeaderExtraData(config *params.ChainConfig, header *types.Header)
return nil
}
// Depending on whether we support or oppose the fork, validate the extra-data contents
if config.DAOForkSupport {
if !bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
return ErrBadProDAOExtra
}
} else {
if bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
return ErrBadNoDAOExtra
if metaminer.IsPoW() {
if config.DAOForkSupport {
if !bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
return ErrBadProDAOExtra
}
} else {
if bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
return ErrBadNoDAOExtra
}
}
}
// All ok, header has the same extra-data we expect
Expand Down

0 comments on commit edb77d5

Please sign in to comment.