core: improved bad block error reporting (#3320)

This commit is contained in:
Jeffrey Wilcke
2016-11-23 13:32:25 +01:00
committed by GitHub
parent e05d35e6e0
commit c04c8f10f0
5 changed files with 47 additions and 18 deletions

View File

@ -17,6 +17,7 @@
package params
import (
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common"
@ -66,6 +67,19 @@ type ChainConfig struct {
EIP158Block *big.Int `json:"eip158Block"` // EIP158 HF block
}
// String implements the Stringer interface.
func (c *ChainConfig) String() string {
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v}",
c.ChainId,
c.HomesteadBlock,
c.DAOForkBlock,
c.DAOForkSupport,
c.EIP150Block,
c.EIP155Block,
c.EIP158Block,
)
}
var (
TestChainConfig = &ChainConfig{big.NewInt(1), new(big.Int), new(big.Int), true, new(big.Int), common.Hash{}, new(big.Int), new(big.Int)}
TestRules = TestChainConfig.Rules(new(big.Int))