func (c *ListenerRegistry) Deregister(proto string) error {
	foundAt := -1
	for i, a := range c.Listeners {
		if a.Protocol == proto {
			foundAt = i
			break
		}
	}

	if foundAt != -1 {
		c.Listeners = append(c.Listeners[:foundAt], c.Listeners[foundAt+1:]...)
		return nil
	}

	return fmt.Errorf("failed to deregister proto %s", proto)
}
// Deregister removes p2p listener from this registry
Deregister removes p2p listener from this registry
// Deregister removes p2p listener from this registry
func (c *ListenerRegistry) Deregister(proto string) error {
	foundAt := -1
	for i, a := range c.Listeners {
		if a.Protocol == proto {
			foundAt = i
			break
		}
	}
	if foundAt != -1 {
		c.Listeners = append(c.Listeners[:foundAt], c.Listeners[foundAt+1:]...)
		return nil
	}
	return fmt.Errorf("failed to deregister proto %s", proto)
}
func ( c * ListenerRegistry ) Deregister ( proto string ) error { foundAt := - 1 for i , a := range c . Listeners { if a . Protocol == proto { foundAt = i break } } if foundAt != - 1 { c . Listeners = append ( c . Listeners [ : foundAt ] , c . Listeners [ foundAt + 1 : ] ... ) return nil } return fmt . Errorf ( " " , proto ) }
Deregister removes p2p listener from this registry
Deregister removes p2p listener from this registry