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

Method Start

ethstorage/p2p/protocol/syncclient.go:499–511  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

497}
498
499func (s *SyncClient) Start() error {
500 // Retrieve the previous sync status from LevelDB and abort if already synced
501 s.loadSyncStatus()
502 s.lock.Lock()
503 s.closingPeers = false
504 s.lock.Unlock()
505
506 s.wg.Add(2)
507 go s.mainLoop()
508 go s.saveStatusLoop()
509
510 return nil
511}
512
513func (s *SyncClient) AddPeer(id peer.ID, shards map[common.Address][]uint64, direction network.Direction) bool {
514 s.lock.Lock()

Callers 5

testSyncFunction · 0.45
TestAddPeerDuringSyncingFunction · 0.45
TestAddPeerAfterSyncDoneFunction · 0.45
TestFillEmptyFunction · 0.45

Calls 3

loadSyncStatusMethod · 0.95
mainLoopMethod · 0.95
saveStatusLoopMethod · 0.95

Tested by 5

testSyncFunction · 0.36
TestAddPeerDuringSyncingFunction · 0.36
TestAddPeerAfterSyncDoneFunction · 0.36
TestFillEmptyFunction · 0.36