Skip to content

Commit 5caf1aa

Browse files
committed
Switched getWork third output from difficulty to target
1 parent 2cc9211 commit 5caf1aa

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎miner/remote_agent.go‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package miner
22

33
import (
4+
"math/big"
5+
46
"github.com/ethereum/ethash"
57
"github.com/ethereum/go-ethereum/common"
68
"github.com/ethereum/go-ethereum/core/types"
@@ -64,7 +66,12 @@ func (a *RemoteAgent) GetWork() [3]string {
6466
res[0] = a.work.HashNoNonce().Hex()
6567
seedHash, _ := ethash.GetSeedHash(a.currentWork.NumberU64())
6668
res[1] = common.Bytes2Hex(seedHash)
67-
res[2] = common.Bytes2Hex(a.work.Difficulty().Bytes())
69+
n := new(big.Int)
70+
n.SetInt64(1)
71+
n.Lsh(n, 255)
72+
n.Div(n, a.work.Difficulty())
73+
n.Lsh(n, 1)
74+
res[2] = common.Bytes2Hex(n.Bytes())
6875
}
6976

7077
return res

0 commit comments

Comments
 (0)