consensus, core: drop all the legacy custom core error types

This commit is contained in:
Péter Szilágyi
2017-04-06 14:58:03 +03:00
parent 702bef8493
commit 158d603528
15 changed files with 115 additions and 261 deletions

View File

@ -18,6 +18,7 @@ package core
import (
"bytes"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/core/state"
@ -46,11 +47,11 @@ func ValidateDAOHeaderExtraData(config *params.ChainConfig, header *types.Header
// Depending whether we support or oppose the fork, validate the extra-data contents
if config.DAOForkSupport {
if !bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
return ValidationError("DAO pro-fork bad block extra-data: 0x%x", header.Extra)
return fmt.Errorf("DAO pro-fork bad block extra-data: 0x%x", header.Extra)
}
} else {
if bytes.Equal(header.Extra, params.DAOForkBlockExtra) {
return ValidationError("DAO no-fork bad block extra-data: 0x%x", header.Extra)
return fmt.Errorf("DAO no-fork bad block extra-data: 0x%x", header.Extra)
}
}
// All ok, header has the same extra-data we expect