(epoch uint64)
| 15 | const CHUNK_SIZE = uint64(4096) |
| 16 | |
| 17 | func 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 | |
| 32 | func ToRealHash(hash common.Hash, maxKvSize, idxWithinChunk uint64, realHash []byte, copyHash bool) []byte { |
| 33 | if len(realHash) != len(hash)+8 { |
no test coverage detected