From 682c4531afeaa3aa6aded275d72eb62819c1e0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 8 Jul 2016 13:00:37 +0300 Subject: [release/1.4.10] cmd/geth, miner, params: special extradata for DAO fork start (cherry picked from commit 1e24c2e4f428c85c2f83272af2696469cb8f5bed) --- miner/worker.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'miner') diff --git a/miner/worker.go b/miner/worker.go index fe759560c..48cde168b 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -33,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/pow" "gopkg.in/fatih/set.v0" ) @@ -468,7 +469,14 @@ func (self *worker) commitNewWork() { Extra: self.extra, Time: big.NewInt(tstamp), } - + // If we are doing a DAO hard-fork check whether to override the extra-data or not + if daoBlock := self.config.DAOForkBlock; daoBlock != nil { + // Check whether the block is among the fork extra-override range + limit := new(big.Int).Add(daoBlock, params.DAOForkExtraRange) + if daoBlock.Cmp(header.Number) <= 0 && header.Number.Cmp(limit) < 0 { + header.Extra = common.CopyBytes(params.DAOForkBlockExtra) + } + } previous := self.current // Could potentially happen if starting to mine in an odd state. err := self.makeCurrent(parent, header) -- cgit v1.2.3