code: func (r *Registry) requestPeerSubscriptions(kad *network.Kademlia, subs map[enode.ID]map[Stream]struct{}) {
  
  	var startPo int
  	var endPo int
  	var ok bool
  
  	// kademlia's depth
  	kadDepth := kad.NeighbourhoodDepth()
  	// request subscriptions for all nodes and bins
  	// nil as base takes the node's base; we need to pass 255 as `EachConn` runs
  	// from deepest bins backwards
  	kad.EachConn(nil, 255, func(p *network.Peer, po int) bool {
  		// nodes that do not provide stream protocol
  		// should not be subscribed, e.g. bootnodes
  		if !p.HasCap("stream") {
  			return true
  		}
  		//if the peer's bin is shallower than the kademlia depth,
  		//only the peer's bin should be subscribed
  		if po < kadDepth {
  			startPo = po
  			endPo = po
  		} else {
  			//if the peer's bin is equal or deeper than the kademlia depth,
  			//each bin from the depth up to k.MaxProxDisplay should be subscribed
  			startPo = kadDepth
  			endPo = kad.MaxProxDisplay
  		}
  
  		for bin := startPo; bin <= endPo; bin++ {
  			//do the actual subscription
  			ok = subscriptionFunc(r, p, uint8(bin), subs)
  		}
  		return ok
  	})
  }
docs: // requestPeerSubscriptions calls on each live peer in the kademlia table
  // and sends a `RequestSubscription` to peers according to their bin
  // and their relationship with kademlia's depth.
  // Also check `TestRequestPeerSubscriptions` in order to understand the
  // expected behavior.
  // The function expects:
  //   * the kademlia
  //   * a map of subscriptions
  //   * the actual function to subscribe
  //     (in case of the test, it doesn't do real subscriptions)