aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-20 06:41:50 +0800
committerobscuren <geffobscura@gmail.com>2015-04-20 06:41:50 +0800
commitfa729a0c55aa4b00c2ac33d0fcee8acabed2f737 (patch)
tree17a0ff86bdc7e0effecafd48b957cdc30bd88040 /miner
parent5caf1aa1a9c8ab6fed8be89324167cc8e22a9daf (diff)
downloaddexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.tar
dexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.tar.gz
dexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.tar.bz2
dexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.tar.lz
dexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.tar.xz
dexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.tar.zst
dexon-fa729a0c55aa4b00c2ac33d0fcee8acabed2f737.zip
miner: go fmt
Diffstat (limited to 'miner')
-rw-r--r--miner/remote_agent.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/miner/remote_agent.go b/miner/remote_agent.go
index fe8cc6b63..87456cfec 100644
--- a/miner/remote_agent.go
+++ b/miner/remote_agent.go
@@ -1,7 +1,7 @@
package miner
import (
- "math/big"
+ "math/big"
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/common"
@@ -59,19 +59,18 @@ out:
func (a *RemoteAgent) GetWork() [3]string {
var res [3]string
- // XXX Wait here until work != nil ?
if a.work != nil {
a.currentWork = a.work
res[0] = a.work.HashNoNonce().Hex()
seedHash, _ := ethash.GetSeedHash(a.currentWork.NumberU64())
res[1] = common.Bytes2Hex(seedHash)
- 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())
+ // Calculate the "target" to be returned to the external miner
+ n := big.NewInt(1)
+ n.Lsh(n, 255)
+ n.Div(n, a.work.Difficulty())
+ n.Lsh(n, 1)
+ res[2] = common.Bytes2Hex(n.Bytes())
}
return res