MCPcopy Create free account
hub / github.com/ethstorage/es-node / Cache

Function Cache

ethstorage/pora/ethash.go:17–30  ·  view source on GitHub ↗
(epoch uint64)

Source from the content-addressed store, hash-verified

15const CHUNK_SIZE = uint64(4096)
16
17func Cache(epoch uint64) *pora.Cache {
18 currentI, futureI := caches.Get(epoch)
19 current := currentI.(*pora.Cache)
20
21 // Wait for generation finish.
22 current.Generate("", 0, false, false)
23
24 // If we need a new future cache, now's a good time to regenerate it.
25 if futureI != nil {
26 future := futureI.(*pora.Cache)
27 go future.Generate("", 0, false, false)
28 }
29 return current
30}
31
32func ToRealHash(hash common.Hash, maxKvSize, idxWithinChunk uint64, realHash []byte, copyHash bool) []byte {
33 if len(realHash) != len(hash)+8 {

Callers 2

GetMaskDataWithInChunkFunction · 0.70
GetMaskDataFunction · 0.70

Calls 2

GetMethod · 0.80
GenerateMethod · 0.80

Tested by

no test coverage detected