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

Method TryReadEncoded

ethstorage/storage_manager.go:607–617  ·  view source on GitHub ↗

TryReadEncoded This function will read the encoded data from the local storage file. It also check whether the blob is empty or not synced, if they are these two cases, it will return err.

(kvIdx uint64, readLen int)

Source from the content-addressed store, hash-verified

605// TryReadEncoded This function will read the encoded data from the local storage file. It also check whether the blob is empty or not synced,
606// if they are these two cases, it will return err.
607func (s *StorageManager) TryReadEncoded(kvIdx uint64, readLen int) ([]byte, bool, error) {
608 s.mu.Lock()
609 defer s.mu.Unlock()
610
611 err := s.syncCheck(kvIdx)
612 if err != nil {
613 return nil, false, err
614 }
615
616 return s.shardManager.TryReadEncoded(kvIdx, readLen)
617}
618
619func (s *StorageManager) TryRead(kvIdx uint64, readLen int, commit common.Hash) ([]byte, bool, error) {
620 s.mu.Lock()

Callers

nothing calls this directly

Calls 2

syncCheckMethod · 0.95
TryReadEncodedMethod · 0.65

Tested by

no test coverage detected