From 6060e098c929792f455d7f580ed91e914d28cf3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 7 Jul 2016 16:04:34 +0300 Subject: cmd, core, eth, params: implement flags to control dao fork blocks --- core/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/config.go') diff --git a/core/config.go b/core/config.go index 81ca76aa3..d557ae5a4 100644 --- a/core/config.go +++ b/core/config.go @@ -31,7 +31,8 @@ var ChainConfigNotFoundErr = errors.New("ChainConfig not found") // general conf // that any network, identified by its genesis block, can have its own // set of configuration options. type ChainConfig struct { - HomesteadBlock *big.Int // homestead switch block + HomesteadBlock *big.Int `json:"homesteadBlock"` // homestead switch block (0 = already homestead) + DAOForkBlock *big.Int `json:"daoForkBlock"` // TheDAO hard-fork block (nil = no fork) VmConfig vm.Config `json:"-"` } @@ -41,6 +42,5 @@ func (c *ChainConfig) IsHomestead(num *big.Int) bool { if num == nil { return false } - return num.Cmp(c.HomesteadBlock) >= 0 } -- cgit v1.2.3 From 9e56811a3773e225bedf6bf0003327ea1aaae040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 8 Jul 2016 11:43:36 +0300 Subject: core: gracefully handle missing homestead block config --- core/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/config.go') diff --git a/core/config.go b/core/config.go index d557ae5a4..d04b00e9c 100644 --- a/core/config.go +++ b/core/config.go @@ -39,7 +39,7 @@ type ChainConfig struct { // IsHomestead returns whether num is either equal to the homestead block or greater. func (c *ChainConfig) IsHomestead(num *big.Int) bool { - if num == nil { + if c.HomesteadBlock == nil || num == nil { return false } return num.Cmp(c.HomesteadBlock) >= 0 -- cgit v1.2.3 From a87089fd2dc08a69a4a4f1ef93db9a2871d819a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 8 Jul 2016 18:48:17 +0300 Subject: cmd, core, miner: add extradata validation to consensus rules --- core/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/config.go') diff --git a/core/config.go b/core/config.go index d04b00e9c..c0d065a57 100644 --- a/core/config.go +++ b/core/config.go @@ -31,8 +31,9 @@ var ChainConfigNotFoundErr = errors.New("ChainConfig not found") // general conf // that any network, identified by its genesis block, can have its own // set of configuration options. type ChainConfig struct { - HomesteadBlock *big.Int `json:"homesteadBlock"` // homestead switch block (0 = already homestead) - DAOForkBlock *big.Int `json:"daoForkBlock"` // TheDAO hard-fork block (nil = no fork) + HomesteadBlock *big.Int `json:"homesteadBlock"` // Homestead switch block (nil = no fork, 0 = already homestead) + DAOForkBlock *big.Int `json:"daoForkBlock"` // TheDAO hard-fork switch block (nil = no fork) + DAOForkSupport bool `json:"daoForkSupport"` // Whether the nodes supports or opposes the DAO hard-fork VmConfig vm.Config `json:"-"` } -- cgit v1.2.3