aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorMatthew Wampler-Doty <matthew.wampler.doty@gmail.com>2015-03-01 03:58:37 +0800
committerMatthew Wampler-Doty <matthew.wampler.doty@gmail.com>2015-03-03 11:29:34 +0800
commitde9f79133faa1ff5dcd16fb4fd13d06b7799ded9 (patch)
treefcc9001d6b681ccdd1b3bbe516e3611e808341d7 /miner/worker.go
parent080823bdeebbab2bcffdaefad703896700ed2c30 (diff)
downloaddexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.gz
dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.tar.zst
dexon-de9f79133faa1ff5dcd16fb4fd13d06b7799ded9.zip
Introducing ethash
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go9
1 files changed, 7 insertions, 2 deletions
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})