()
| 497 | } |
| 498 | |
| 499 | func (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 | |
| 513 | func (s *SyncClient) AddPeer(id peer.ID, shards map[common.Address][]uint64, direction network.Direction) bool { |
| 514 | s.lock.Lock() |