(dagSize uint64, hash common.Hash, nonce uint64)
| 113 | } |
| 114 | |
| 115 | func (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. |
no test coverage detected