aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-22 22:44:00 +0800
committerobscuren <geffobscura@gmail.com>2015-03-22 22:44:00 +0800
commit8ed4f226d1dbecc9625a2f142e22926569198b73 (patch)
tree5eaf9d133e5f3a2995327f4b5dc8fb214976bd81 /rpc
parent82956df523fd75d0c3b4a49f571eee60935fc32e (diff)
downloaddexon-8ed4f226d1dbecc9625a2f142e22926569198b73.tar
dexon-8ed4f226d1dbecc9625a2f142e22926569198b73.tar.gz
dexon-8ed4f226d1dbecc9625a2f142e22926569198b73.tar.bz2
dexon-8ed4f226d1dbecc9625a2f142e22926569198b73.tar.lz
dexon-8ed4f226d1dbecc9625a2f142e22926569198b73.tar.xz
dexon-8ed4f226d1dbecc9625a2f142e22926569198b73.tar.zst
dexon-8ed4f226d1dbecc9625a2f142e22926569198b73.zip
check for nil ptrs
Diffstat (limited to 'rpc')
-rw-r--r--rpc/miner_agest.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/miner_agest.go b/rpc/miner_agest.go
index f883ef54e..64dba82a6 100644
--- a/rpc/miner_agest.go
+++ b/rpc/miner_agest.go
@@ -55,7 +55,7 @@ out:
}
func (a *Agent) GetWork() common.Hash {
- // XXX Wait here untill work != nil ?
+ // XXX Wait here untill work != nil ?.
if a.work != nil {
return a.work.HashNoNonce()
}
@@ -64,7 +64,7 @@ func (a *Agent) GetWork() common.Hash {
func (a *Agent) SetResult(nonce uint64, mixDigest, seedHash common.Hash) {
// Make sure the external miner was working on the right hash
- if a.currentWork.Hash() == a.work.Hash() {
+ if a.currentWork != nil && a.work != nil && a.currentWork.Hash() == a.work.Hash() {
a.returnCh <- miner.Work{a.currentWork.Number().Uint64(), nonce, mixDigest.Bytes(), seedHash.Bytes()}
}
}