aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-04 00:20:34 +0800
committerobscuren <geffobscura@gmail.com>2015-03-04 00:20:34 +0800
commit22b132e28f74cabef38a55874da8e3db93786144 (patch)
tree2ae0e114e8aaf7dfba259c5e64979575bec4004b /miner
parentee0a1bec6c3ce942e51265535961ac6a745d33eb (diff)
parentde9f79133faa1ff5dcd16fb4fd13d06b7799ded9 (diff)
downloaddexon-22b132e28f74cabef38a55874da8e3db93786144.tar.gz
dexon-22b132e28f74cabef38a55874da8e3db93786144.tar.zst
dexon-22b132e28f74cabef38a55874da8e3db93786144.zip
Merge branch 'publictests' of https://github.com/xcthulhu/go-ethereum into xcthulhu-publictests
Diffstat (limited to 'miner')
-rw-r--r--miner/agent.go4
-rw-r--r--miner/worker.go9
2 files changed, 9 insertions, 4 deletions
diff --git a/miner/agent.go b/miner/agent.go
index 9046f5d5a..5b2bfdb06 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -69,8 +69,8 @@ done:
func (self *CpuMiner) mine(block *types.Block) {
minerlogger.Infof("(re)started agent[%d]. mining...\n", self.index)
- nonce := self.pow.Search(block, self.quitCurrentOp)
+ nonce, mixDigest, seedHash := self.pow.Search(block, self.quitCurrentOp)
if nonce != nil {
- self.returnCh <- Work{block.Number().Uint64(), nonce}
+ self.returnCh <- Work{block.Number().Uint64(), nonce, mixDigest, seedHash}
}
}
diff --git a/miner/worker.go b/miner/worker.go
index 4f0909302..201367fdf 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -42,8 +42,10 @@ func env(block *types.Block, eth core.Backend) *environment {
}
type Work struct {
- Number uint64
- Nonce []byte
+ Number uint64
+ Nonce []byte
+ MixDigest []byte
+ SeedHash []byte
}
type Agent interface {
@@ -138,9 +140,12 @@ out:
func (self *worker) wait() {
for {
for work := range self.recv {
+ // Someone Successfully Mined!
block := self.current.block
if block.Number().Uint64() == work.Number && block.Nonce() == nil {
self.current.block.Header().Nonce = work.Nonce
+ self.current.block.Header().MixDigest = work.MixDigest
+ self.current.block.Header().SeedHash = work.SeedHash
if err := self.chain.InsertChain(types.Blocks{self.current.block}); err == nil {
self.mux.Post(core.NewMinedBlockEvent{self.current.block})