diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 15:28:54 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 15:28:54 +0800 |
commit | 372e1cad5bf02b83fd3c0becc442a5f5817f9d36 (patch) | |
tree | cea510b7e0f175d67fba39d1b4807eb835fa8af3 /rpc/miner_agest.go | |
parent | 8affdf96e23f092b7fe24d168b024b10eab35e05 (diff) | |
download | go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.tar go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.tar.gz go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.tar.bz2 go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.tar.lz go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.tar.xz go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.tar.zst go-tangerine-372e1cad5bf02b83fd3c0becc442a5f5817f9d36.zip |
Cleanup get/submitWork
getWork needs to return additional values
Diffstat (limited to 'rpc/miner_agest.go')
-rw-r--r-- | rpc/miner_agest.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rpc/miner_agest.go b/rpc/miner_agest.go index 64dba82a6..46fb87207 100644 --- a/rpc/miner_agest.go +++ b/rpc/miner_agest.go @@ -55,6 +55,8 @@ out: } func (a *Agent) GetWork() common.Hash { + // TODO return HashNoNonce, DAGSeedHash, Difficulty + // XXX Wait here untill work != nil ?. if a.work != nil { return a.work.HashNoNonce() @@ -62,9 +64,14 @@ func (a *Agent) GetWork() common.Hash { return common.Hash{} } -func (a *Agent) SetResult(nonce uint64, mixDigest, seedHash common.Hash) { +func (a *Agent) SetResult(nonce uint64, mixDigest, seedHash common.Hash) bool { + // Return true or false, but does not indicate if the PoW was correct + // Make sure the external miner was working on the right 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()} + return true } + + return false } |