|
|
|
@ -1,6 +1,8 @@ |
|
|
|
|
package miner |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"math/big" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/ethash" |
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
@ -64,7 +66,12 @@ func (a *RemoteAgent) GetWork() [3]string { |
|
|
|
|
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()) |
|
|
|
|
n := new(big.Int) |
|
|
|
|
n.SetInt64(1) |
|
|
|
|
n.Lsh(n, 255) |
|
|
|
|
n.Div(n, a.work.Difficulty()) |
|
|
|
|
n.Lsh(n, 1) |
|
|
|
|
res[2] = common.Bytes2Hex(n.Bytes()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return res |
|
|
|
|