aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-23 15:55:06 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-23 15:55:06 +0800
commit16a58f8f2ae860eae28a7d315eb2c9e533c12c3b (patch)
tree8d45eec3f0ff37f722c4b003545ad1ec4db929a2
parent31879eca8cfb9b759944ca48590a22e7509a58c5 (diff)
downloaddexon-16a58f8f2ae860eae28a7d315eb2c9e533c12c3b.tar.gz
dexon-16a58f8f2ae860eae28a7d315eb2c9e533c12c3b.tar.zst
dexon-16a58f8f2ae860eae28a7d315eb2c9e533c12c3b.zip
Always return 3 strings
-rw-r--r--rpc/miner_agent.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/rpc/miner_agent.go b/rpc/miner_agent.go
index e812a7d51..4df109a94 100644
--- a/rpc/miner_agent.go
+++ b/rpc/miner_agent.go
@@ -54,16 +54,15 @@ out:
}
}
-func (a *Agent) GetWork() []string {
+func (a *Agent) GetWork() [3]string {
// TODO return HashNoNonce, DAGSeedHash, Difficulty
- var res = []string{}
+ var res [3]string
// XXX Wait here untill work != nil ?.
if a.work != nil {
- // Ideally append in 1 call once params are determined
- res = append(res, a.work.HashNoNonce().Hex()) // Header Hash No Nonce
- res = append(res, common.Hash{}.Hex()) // DAG Seed
- res = append(res, common.Hash{}.Hex()) // Difficulty
+ res[0] = a.work.HashNoNonce().Hex() // Header Hash No Nonce
+ res[1] = common.Hash{}.Hex() // DAG Seed
+ res[2] = common.Hash{}.Hex() // Difficulty
}
return res