Skip to content

Commit fa729a0

Browse files
committed
miner: go fmt
1 parent 5caf1aa commit fa729a0

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎miner/remote_agent.go‎

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

33
import (
4-
"math/big"
4+
"math/big"
55

66
"github.com/ethereum/ethash"
77
"github.com/ethereum/go-ethereum/common"
@@ -59,19 +59,18 @@ out:
5959
func (a *RemoteAgent) GetWork() [3]string {
6060
var res [3]string
6161

62-
// XXX Wait here until work != nil ?
6362
if a.work != nil {
6463
a.currentWork = a.work
6564

6665
res[0] = a.work.HashNoNonce().Hex()
6766
seedHash, _ := ethash.GetSeedHash(a.currentWork.NumberU64())
6867
res[1] = common.Bytes2Hex(seedHash)
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())
68+
// Calculate the "target" to be returned to the external miner
69+
n := big.NewInt(1)
70+
n.Lsh(n, 255)
71+
n.Div(n, a.work.Difficulty())
72+
n.Lsh(n, 1)
73+
res[2] = common.Bytes2Hex(n.Bytes())
7574
}
7675

7776
return res

0 commit comments

Comments
 (0)