aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-04 04:04:31 +0800
committerobscuren <geffobscura@gmail.com>2015-03-04 04:04:31 +0800
commit26de12d9bf23bce7de26b3b6629601ec2e58ad5b (patch)
tree0d4b76fcb717049d988b7f283967f43dc5517a5e /miner
parente9f1e868e2bc0205d0b7655cd07fcaba9b2bc97d (diff)
downloaddexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.tar
dexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.tar.gz
dexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.tar.bz2
dexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.tar.lz
dexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.tar.xz
dexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.tar.zst
dexon-26de12d9bf23bce7de26b3b6629601ec2e58ad5b.zip
Changed nonce to a uint64
Diffstat (limited to 'miner')
-rw-r--r--miner/agent.go2
-rw-r--r--miner/worker.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/miner/agent.go b/miner/agent.go
index 6c21d8015..6865d5a08 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -75,7 +75,7 @@ done:
func (self *CpuMiner) mine(block *types.Block) {
minerlogger.Infof("(re)started agent[%d]. mining...\n", self.index)
nonce, mixDigest, seedHash := self.pow.Search(block, self.quitCurrentOp)
- if nonce != nil {
+ if nonce != 0 {
self.returnCh <- Work{block.Number().Uint64(), nonce, mixDigest, seedHash}
}
}
diff --git a/miner/worker.go b/miner/worker.go
index 1388b22b0..8904c9973 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -47,7 +47,7 @@ func env(block *types.Block, eth core.Backend) *environment {
type Work struct {
Number uint64
- Nonce []byte
+ Nonce uint64
MixDigest []byte
SeedHash []byte
}
@@ -150,7 +150,7 @@ func (self *worker) wait() {
for work := range self.recv {
// Someone Successfully Mined!
block := self.current.block
- if block.Number().Uint64() == work.Number && block.Nonce() == nil {
+ if block.Number().Uint64() == work.Number && block.Nonce() == 0 {
self.current.block.Header().Nonce = work.Nonce
self.current.block.Header().MixDigest = work.MixDigest
self.current.block.Header().SeedHash = work.SeedHash
@@ -242,7 +242,7 @@ func (self *worker) commitUncle(uncle *types.Header) error {
}
if !self.pow.Verify(types.NewBlockWithHeader(uncle)) {
- return core.ValidationError("Uncle's nonce is invalid (= %v)", ethutil.Bytes2Hex(uncle.Nonce))
+ return core.ValidationError("Uncle's nonce is invalid (= %x)", uncle.Nonce)
}
uncleAccount := self.current.state.GetAccount(uncle.Coinbase)