Commit 01c0ba22 authored by Taylor Gerring's avatar Taylor Gerring

Add DAG seed hash and difficulty to GetWork

parent 0846e156
package xeth package xeth
import ( import (
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/miner"
...@@ -55,14 +56,14 @@ out: ...@@ -55,14 +56,14 @@ out:
} }
func (a *Agent) GetWork() [3]string { func (a *Agent) GetWork() [3]string {
// TODO return HashNoNonce, DAGSeedHash, Difficulty
var res [3]string var res [3]string
// XXX Wait here untill work != nil ?. // XXX Wait here until work != nil ?
if a.work != nil { if a.work != nil {
res[0] = a.work.HashNoNonce().Hex() // Header Hash No Nonce res[0] = a.work.HashNoNonce().Hex()
res[1] = common.Hash{}.Hex() // DAG Seed seedHash, _ := ethash.GetSeedHash(a.currentWork.NumberU64())
res[2] = common.Hash{}.Hex() // Difficulty res[1] = common.Bytes2Hex(seedHash)
res[2] = common.Bytes2Hex(a.work.Difficulty().Bytes())
} }
return res return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment