Skip to content

API.SubmitWork

Source (upstream pre-purge) Current
File consensus/ethash/api.go api.go
Symbol API.SubmitWork API.SubmitWork
Ref dde2da0ef~1 etc/v1.17.3-full-node

3-way merge — purge → getc ← upstream

pre-purge
// 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(nonce types.BlockNonce, hash, digest common.Hash) bool {
if api.ethash.remote == nil {
return false
}
var errc = make(chan error, 1)
select {
case api.ethash.remote.submitWorkCh <- &mineResult{
nonce: nonce,
mixDigest: digest,
hash: hash,
errc: errc,
}:
case <-api.ethash.remote.exitCh:
return false
}
err := <-errc
return err == nil
}
core-geth validation — **Identical** ✅ | | | |---|---| | File | [`api.go`](https://github.com/etclabscore/core-geth/blob/v1.12.20/consensus/ethash/api.go) | | Symbol | `API.SubmitWork` | | Ref | `v1.12.20` |

← Consensus & Ethash