diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 15:45:09 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-23 15:45:09 +0800 |
commit | 31879eca8cfb9b759944ca48590a22e7509a58c5 (patch) | |
tree | 9070d5e8aa3eb39bdb9033c6be109f920eb11ede /rpc | |
parent | 3772f02569fcc5a3e59e6b9e0dc901fd5e171add (diff) | |
download | go-tangerine-31879eca8cfb9b759944ca48590a22e7509a58c5.tar.gz go-tangerine-31879eca8cfb9b759944ca48590a22e7509a58c5.tar.zst go-tangerine-31879eca8cfb9b759944ca48590a22e7509a58c5.zip |
Stub corrected getWork response
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/api.go | 2 | ||||
-rw-r--r-- | rpc/miner_agent.go | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/rpc/api.go b/rpc/api.go index 1102b7cb2..e0a3e5c08 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -349,7 +349,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error *reply = NewLogsRes(p.xeth().AllLogs(opts)) case "eth_getWork": p.xeth().SetMining(true) - *reply = p.agent.GetWork().Hex() + *reply = p.agent.GetWork() case "eth_submitWork": args := new(SubmitWorkArgs) if err := json.Unmarshal(req.Params, &args); err != nil { diff --git a/rpc/miner_agent.go b/rpc/miner_agent.go index 46fb87207..e812a7d51 100644 --- a/rpc/miner_agent.go +++ b/rpc/miner_agent.go @@ -54,14 +54,19 @@ out: } } -func (a *Agent) GetWork() common.Hash { +func (a *Agent) GetWork() []string { // TODO return HashNoNonce, DAGSeedHash, Difficulty + var res = []string{} // XXX Wait here untill work != nil ?. if a.work != nil { - return a.work.HashNoNonce() + // 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 } - return common.Hash{} + + return res } func (a *Agent) SetResult(nonce uint64, mixDigest, seedHash common.Hash) bool { |