aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitalik Buterin <v@buterin.com>2015-04-20 05:42:21 +0800
committerVitalik Buterin <v@buterin.com>2015-04-20 05:42:21 +0800
commit5caf1aa1a9c8ab6fed8be89324167cc8e22a9daf (patch)
treeea0c73443c3f7f3b67390b92329c1a44e8a490d9
parent2cc92112699be80d9be08a1de288fb479cdf391e (diff)
downloadgo-tangerine-5caf1aa1a9c8ab6fed8be89324167cc8e22a9daf.tar.gz
go-tangerine-5caf1aa1a9c8ab6fed8be89324167cc8e22a9daf.tar.zst
go-tangerine-5caf1aa1a9c8ab6fed8be89324167cc8e22a9daf.zip
Switched getWork third output from difficulty to target
-rw-r--r--miner/remote_agent.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/miner/remote_agent.go b/miner/remote_agent.go
index 1482f4c0f..fe8cc6b63 100644
--- a/miner/remote_agent.go
+++ b/miner/remote_agent.go
@@ -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