close peer sync config connections to prevent duplicate peer sync config creation

pull/1484/head
Dennis Won 5 years ago
parent cf9a4a49dd
commit daf4767a51
  1. 3
      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 {

Loading…
Cancel
Save