mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 05:27:19 +00:00
Stub corrected getWork response
This commit is contained in:
parent
3772f02569
commit
31879eca8c
@ -349,7 +349,7 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
|
|||||||
*reply = NewLogsRes(p.xeth().AllLogs(opts))
|
*reply = NewLogsRes(p.xeth().AllLogs(opts))
|
||||||
case "eth_getWork":
|
case "eth_getWork":
|
||||||
p.xeth().SetMining(true)
|
p.xeth().SetMining(true)
|
||||||
*reply = p.agent.GetWork().Hex()
|
*reply = p.agent.GetWork()
|
||||||
case "eth_submitWork":
|
case "eth_submitWork":
|
||||||
args := new(SubmitWorkArgs)
|
args := new(SubmitWorkArgs)
|
||||||
if err := json.Unmarshal(req.Params, &args); err != nil {
|
if err := json.Unmarshal(req.Params, &args); err != nil {
|
||||||
|
@ -54,14 +54,19 @@ out:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Agent) GetWork() common.Hash {
|
func (a *Agent) GetWork() []string {
|
||||||
// TODO return HashNoNonce, DAGSeedHash, Difficulty
|
// TODO return HashNoNonce, DAGSeedHash, Difficulty
|
||||||
|
var res = []string{}
|
||||||
|
|
||||||
// XXX Wait here untill work != nil ?.
|
// XXX Wait here untill work != nil ?.
|
||||||
if a.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 {
|
func (a *Agent) SetResult(nonce uint64, mixDigest, seedHash common.Hash) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user