code: func (r *Registry) updateSyncing() {
  	kad := r.delivery.kad
  	// map of all SYNC streams for all peers
  	// used at the and of the function to remove servers
  	// that are not needed anymore
  	subs := make(map[enode.ID]map[Stream]struct{})
  	r.peersMu.RLock()
  	for id, peer := range r.peers {
  		peer.serverMu.RLock()
  		for stream := range peer.servers {
  			if stream.Name == "SYNC" {
  				if _, ok := subs[id]; !ok {
  					subs[id] = make(map[Stream]struct{})
  				}
  				subs[id][stream] = struct{}{}
  			}
  		}
  		peer.serverMu.RUnlock()
  	}
  	r.peersMu.RUnlock()
  
  	// start requesting subscriptions from peers
  	r.requestPeerSubscriptions(kad, subs)
  
  	// remove SYNC servers that do not need to be subscribed
  	for id, streams := range subs {
  		if len(streams) == 0 {
  			continue
  		}
  		peer := r.getPeer(id)
  		if peer == nil {
  			continue
  		}
  		for stream := range streams {
  			log.Debug("Remove sync server", "peer", id, "stream", stream)
  			err := r.Quit(peer.ID(), stream)
  			if err != nil && err != p2p.ErrShuttingDown {
  				log.Error("quit", "err", err, "peer", peer.ID(), "stream", stream)
  			}
  		}
  	}
  }
docs: // updateSyncing subscribes to SYNC streams by iterating over the
  // kademlia connections and bins. If there are existing SYNC streams
  // and they are no longer required after iteration, request to Quit
  // them will be send to appropriate peers.