Skip to content

Commit

Permalink
Stub corrected getWork response
Browse files Browse the repository at this point in the history
  • Loading branch information
tgerring committed Mar 23, 2015
1 parent 3772f02 commit 31879ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 8 additions & 3 deletions rpc/miner_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 31879ec

Please sign in to comment.