diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-07-08 18:00:37 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-07-15 21:52:55 +0800 |
commit | 1e24c2e4f428c85c2f83272af2696469cb8f5bed (patch) | |
tree | 8939d4ddee2b093f01ed656b1603c8d3efc76706 /miner | |
parent | 9e56811a3773e225bedf6bf0003327ea1aaae040 (diff) | |
download | go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.tar go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.tar.gz go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.tar.bz2 go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.tar.lz go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.tar.xz go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.tar.zst go-tangerine-1e24c2e4f428c85c2f83272af2696469cb8f5bed.zip |
cmd/geth, miner, params: special extradata for DAO fork start
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/miner/worker.go b/miner/worker.go index 09cf6b6aa..7197a33ba 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) |