aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
Diffstat (limited to 'miner')
-rw-r--r--miner/agent.go3
-rw-r--r--miner/remote_agent.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/miner/agent.go b/miner/agent.go
index 16f2a7723..697e3971b 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -22,6 +22,7 @@ import (
"sync/atomic"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/pow"
@@ -112,7 +113,7 @@ func (self *CpuAgent) mine(work *Work, stop <-chan struct{}) {
// Mine
nonce, mixDigest := self.pow.Search(work.Block, stop, self.index)
if nonce != 0 {
- block := work.Block.WithMiningResult(nonce, common.BytesToHash(mixDigest))
+ block := work.Block.WithMiningResult(types.EncodeNonce(nonce), common.BytesToHash(mixDigest))
self.returnCh <- &Result{work, block}
} else {
self.returnCh <- nil
diff --git a/miner/remote_agent.go b/miner/remote_agent.go
index f99f38b36..23277bac8 100644
--- a/miner/remote_agent.go
+++ b/miner/remote_agent.go
@@ -25,6 +25,7 @@ import (
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/pow"
@@ -132,7 +133,7 @@ func (a *RemoteAgent) GetWork() ([3]string, error) {
// SubmitWork tries to inject a PoW solution tinto the remote agent, returning
// whether the solution was acceted or not (not can be both a bad PoW as well as
// any other error, like no work pending).
-func (a *RemoteAgent) SubmitWork(nonce uint64, mixDigest, hash common.Hash) bool {
+func (a *RemoteAgent) SubmitWork(nonce types.BlockNonce, mixDigest, hash common.Hash) bool {
a.mu.Lock()
defer a.mu.Unlock()