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

Method RequestL2List

ethstorage/p2p/protocol/syncclient.go:641–659  ·  view source on GitHub ↗
(indexes []uint64)

Source from the content-addressed store, hash-verified

639}
640
641func (s *SyncClient) RequestL2List(indexes []uint64) (uint64, error) {
642 if len(indexes) == 0 {
643 return 0, nil
644 }
645 for _, pr := range s.peers {
646 id := rand.Uint64()
647 var packet BlobsByListPacket
648 _, err := pr.RequestBlobsByList(id, s.storageManager.ContractAddress(), indexes[0]/s.storageManager.KvEntries(), indexes, &packet)
649 if err != nil {
650 return 0, err
651 }
652 _, _, _, err = s.onResult(packet.Blobs)
653 if err != nil {
654 return 0, err
655 }
656 return id, nil
657 }
658 return 0, fmt.Errorf("no peer can be used to send requests")
659}
660
661func (s *SyncClient) mainLoop() {
662 defer s.wg.Done()

Callers 1

TestSync_RequestL2ListFunction · 0.80

Calls 4

onResultMethod · 0.95
RequestBlobsByListMethod · 0.80
ContractAddressMethod · 0.65
KvEntriesMethod · 0.65

Tested by 1

TestSync_RequestL2ListFunction · 0.64