MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / compute

Method compute

ethereum/ethash/ethash.go:115–122  ·  view source on GitHub ↗
(dagSize uint64, hash common.Hash, nonce uint64)

Source from the content-addressed store, hash-verified

113}
114
115func (cache *cache) compute(dagSize uint64, hash common.Hash, nonce uint64) (ok bool, mixDigest, result common.Hash) {
116 ret := C.ethash_light_compute_internal(cache.ptr, C.uint64_t(dagSize), hashToH256(hash), C.uint64_t(nonce))
117 // Make sure cache is live until after the C call.
118 // This is important because a GC might happen and execute
119 // the finalizer before the call completes.
120 _ = cache
121 return bool(ret.success), h256ToHash(ret.mix_hash), h256ToHash(ret.result)
122}
123
124// Light implements the Verify half of the proof of work. It uses a few small
125// in-memory caches to verify the nonces found by Full.

Callers 2

SolutionStateMethod · 0.80
VerifyMethod · 0.80

Calls 2

hashToH256Function · 0.85
h256ToHashFunction · 0.85

Tested by

no test coverage detected