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

Method Reset

ethstorage/storage_manager.go:197–209  ·  view source on GitHub ↗

Reset This function must be called before calling any other funcs, it will setup a local L1 view for the node.

(newL1 int64)

Source from the content-addressed store, hash-verified

195
196// Reset This function must be called before calling any other funcs, it will setup a local L1 view for the node.
197func (s *StorageManager) Reset(newL1 int64) error {
198 s.mu.Lock()
199 defer s.mu.Unlock()
200
201 kvEntryCount, err := s.l1Source.GetStorageKvEntryCount(newL1)
202 if err != nil {
203 return err
204 }
205 s.kvEntryCount = kvEntryCount
206 s.localL1 = newL1
207
208 return nil
209}
210
211// CommitBlobs This function will be called when p2p sync received blobs. It will commit the blobs
212// that match local L1 view and return the unmatched ones.

Callers 14

TestSync_RequestL2RangeFunction · 0.95
TestSync_RequestL2ListFunction · 0.95
testSyncFunction · 0.95
TestAddPeerDuringSyncingFunction · 0.95
TestAddPeerAfterSyncDoneFunction · 0.95
TestFillEmptyFunction · 0.95
prepareDataFunction · 0.80
StartMethod · 0.80
ResetStaticMetricsMethod · 0.80
DiscoveryProcessMethod · 0.80

Calls 1

Tested by 9

TestSync_RequestL2RangeFunction · 0.76
TestSync_RequestL2ListFunction · 0.76
testSyncFunction · 0.76
TestAddPeerDuringSyncingFunction · 0.76
TestAddPeerAfterSyncDoneFunction · 0.76
TestFillEmptyFunction · 0.76
prepareDataFunction · 0.64