aboutsummaryrefslogtreecommitdiffstats
path: root/miner/agent.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-30 06:44:23 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-30 06:44:23 +0800
commit7c4ed8055cc036214279e3ebded74c58d6808d05 (patch)
treeb35a10b7a41c5e1f03300c7afb51f8a76202dbf8 /miner/agent.go
parent9d8b512b27f691fc1980b850e04eb436a3938626 (diff)
parent992e4f83cb05946fa53132a9184d4ac3f38b62bc (diff)
downloadgo-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.tar
go-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.tar.gz
go-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.tar.bz2
go-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.tar.lz
go-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.tar.xz
go-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.tar.zst
go-tangerine-7c4ed8055cc036214279e3ebded74c58d6808d05.zip
Merge pull request #1357 from obscuren/core-optimisations-2
core: optimisations
Diffstat (limited to 'miner/agent.go')
-rw-r--r--miner/agent.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/miner/agent.go b/miner/agent.go
index 3ed3ba839..a7d017aa5 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -90,15 +90,13 @@ done:
}
}
-func (self *CpuAgent) mine(block *types.Block, stop <- chan struct{}) {
+func (self *CpuAgent) mine(block *types.Block, stop <-chan struct{}) {
glog.V(logger.Debug).Infof("(re)started agent[%d]. mining...\n", self.index)
// Mine
nonce, mixDigest := self.pow.Search(block, stop)
if nonce != 0 {
- block.SetNonce(nonce)
- block.Header().MixDigest = common.BytesToHash(mixDigest)
- self.returnCh <- block
+ self.returnCh <- block.WithMiningResult(nonce, common.BytesToHash(mixDigest))
} else {
self.returnCh <- nil
}