diff options
Diffstat (limited to 'miner')
-rw-r--r-- | miner/miner.go | 5 | ||||
-rw-r--r-- | miner/worker.go | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/miner/miner.go b/miner/miner.go index 581de9674..23e48db40 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -13,7 +13,6 @@ type Miner struct { worker *worker MinAcceptedGasPrice *big.Int - Extra string mining bool eth core.Backend @@ -58,3 +57,7 @@ func (self *Miner) Stop() { func (self *Miner) HashRate() int64 { return self.worker.HashRate() } + +func (self *Miner) SetExtra(extra []byte) { + self.worker.extra = extra +} diff --git a/miner/worker.go b/miner/worker.go index 17afa25de..da10cf7cd 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -69,10 +69,12 @@ type worker struct { pow pow.PoW atWork int64 - eth core.Backend - chain *core.ChainManager - proc *core.BlockProcessor + eth core.Backend + chain *core.ChainManager + proc *core.BlockProcessor + coinbase common.Address + extra []byte current *environment @@ -213,6 +215,7 @@ func (self *worker) commitNewWork() { if block.Time() == self.chain.CurrentBlock().Time() { block.Header().Time++ } + block.Header().Extra = self.extra self.current = env(block, self.eth) for _, ancestor := range self.chain.GetAncestors(block, 7) { |