diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 18:09:48 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 18:09:48 +0800 |
commit | 01c0ba22ae597a43be4e06e590175cf6c4dacde1 (patch) | |
tree | 2b13d2d90550bba8a0c7ebd2729e5d4e03f48ff5 | |
parent | 0846e156678b91416652359ffa7941c647cec37d (diff) | |
download | dexon-01c0ba22ae597a43be4e06e590175cf6c4dacde1.tar.gz dexon-01c0ba22ae597a43be4e06e590175cf6c4dacde1.tar.zst dexon-01c0ba22ae597a43be4e06e590175cf6c4dacde1.zip |
Add DAG seed hash and difficulty to GetWork
-rw-r--r-- | xeth/miner_agent.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xeth/miner_agent.go b/xeth/miner_agent.go index 181ab950a..b2e877ed2 100644 --- a/xeth/miner_agent.go +++ b/xeth/miner_agent.go @@ -1,6 +1,7 @@ package xeth import ( + "github.com/ethereum/ethash" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/miner" @@ -55,14 +56,14 @@ out: } func (a *Agent) GetWork() [3]string { - // TODO return HashNoNonce, DAGSeedHash, Difficulty var res [3]string - // XXX Wait here untill work != nil ?. + // XXX Wait here until work != nil ? if a.work != nil { - res[0] = a.work.HashNoNonce().Hex() // Header Hash No Nonce - res[1] = common.Hash{}.Hex() // DAG Seed - res[2] = common.Hash{}.Hex() // Difficulty + res[0] = a.work.HashNoNonce().Hex() + seedHash, _ := ethash.GetSeedHash(a.currentWork.NumberU64()) + res[1] = common.Bytes2Hex(seedHash) + res[2] = common.Bytes2Hex(a.work.Difficulty().Bytes()) } return res |