diff --git a/api/service/syncing/syncing.go b/api/service/syncing/syncing.go index 0f87c8a6a..a1c1e7b04 100644 --- a/api/service/syncing/syncing.go +++ b/api/service/syncing/syncing.go @@ -217,6 +217,9 @@ func (ss *StateSync) CreateSyncConfig(peers []p2p.Peer, isBeacon bool) error { if len(peers) == 0 { return ctxerror.New("[SYNC] no peers to connect to") } + if ss.syncConfig != nil { + ss.syncConfig.CloseConnections() + } ss.syncConfig = &SyncConfig{} var wg sync.WaitGroup for _, peer := range peers {