Skip to content

Commit edb77d5

Browse files
committed
consensus/misc: not checking extra data on metadium mainnet
1 parent 98bc33d commit edb77d5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

consensus/misc/dao.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
"github.com/ethereum/go-ethereum/core/state"
2525
"github.com/ethereum/go-ethereum/core/types"
26+
metaminer "github.com/ethereum/go-ethereum/metadium/miner"
2627
"github.com/ethereum/go-ethereum/params"
2728
)
2829

@@ -55,13 +56,15 @@ func VerifyDAOHeaderExtraData(config *params.ChainConfig, header *types.Header)
5556
return nil
5657
}
5758
// Depending on whether we support or oppose the fork, validate the extra-data contents
58-
if config.DAOForkSupport {
59-
if !bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
60-
return ErrBadProDAOExtra
61-
}
62-
} else {
63-
if bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
64-
return ErrBadNoDAOExtra
59+
if metaminer.IsPoW() {
60+
if config.DAOForkSupport {
61+
if !bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
62+
return ErrBadProDAOExtra
63+
}
64+
} else {
65+
if bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
66+
return ErrBadNoDAOExtra
67+
}
6568
}
6669
}
6770
// All ok, header has the same extra-data we expect

0 commit comments

Comments
 (0)