SubmitHashrate can be used for remote miners to submit their hash rate. This enables the node to report the combined hash rate of all miners which submit work through this node.
It accepts the miner hash rate and an identifier which must be unique between nodes.
func(api*API)SubmitHashrate(ratehexutil.Uint64,idcommon.Hash)bool{ifapi.ethash.remote==nil{returnfalse}vardone=make(chanstruct{},1)select{caseapi.ethash.remote.submitRateCh<-&hashrate{done:done,rate:uint64(rate),id:id}:case<-api.ethash.remote.exitCh:returnfalse}<-donereturntrue}// SubmitHashrate can be used for remote miners to submit their hash rate.// This enables the node to report the combined hash rate of all miners// which submit work through this node.//// It accepts the miner hash rate and an identifier which must be unique// between nodes.
SubmitWork can be used by external miner to submit their POW solution. It returns an indication if the work was accepted. Note either an invalid solution, a stale work a non-existent work will return false.
func(api*API)SubmitWork(noncetypes.BlockNonce,hash,digestcommon.Hash)bool{ifapi.ethash.remote==nil{returnfalse}varerrc=make(chanerror,1)select{caseapi.ethash.remote.submitWorkCh<-&mineResult{nonce:nonce,mixDigest:digest,hash:hash,errc:errc}:case<-api.ethash.remote.exitCh:returnfalse}err:=<-errcreturnerr==nil}// SubmitWork can be used by external miner to submit their POW solution.// It returns an indication if the work was accepted.// Note either an invalid solution, a stale work a non-existent work will return false.