func (cm *connectionMaker) Targets(activeOnly bool) []string {
	resultChan := make(chan []string)
	cm.actionChan <- func() bool {
		var slice []string
		for peer, addr := range cm.directPeers {
			if activeOnly {
				if target, ok := cm.targets[cm.completeAddr(*addr)]; ok && target.tryAfter.IsZero() {
					continue
				}
			}
			slice = append(slice, peer)
		}
		resultChan <- slice
		return false
	}
	return <-resultChan
}
func (cm *connectionMaker) Targets(activeOnly bool) []string {
	resultChan := make(chan []string)
	cm.actionChan <- func() bool {
		var slice []string
		for peer, addr := range cm.directPeers {
			if activeOnly {
				if target, ok := cm.targets[cm.completeAddr(*addr)]; ok && target.tryAfter.IsZero() {
					continue
				}
			}
			slice = append(slice, peer)
		}
		resultChan <- slice
		return false
	}
	return <-resultChan
}
func ( cm * connectionMaker ) Targets ( activeOnly bool ) [ ] string { resultChan := make ( chan [ ] string ) cm . actionChan <- func ( ) bool { var slice [ ] string for peer , addr := range cm . directPeers { if activeOnly { if target , ok := cm . targets [ cm . completeAddr ( * addr ) ] ; ok && target . tryAfter . IsZero ( ) { continue } } slice = append ( slice , peer ) } resultChan <- slice return false } return <- resultChan }
// Targets takes a snapshot of the targets (direct peers),
// either just the ones we are still trying, or all of them.
// Note these are the same things that InitiateConnections and ForgetConnections talks about,
// but a method to retrieve 'Connections' would obviously return the current connections.
Targets takes a snapshot of the targets ( direct peers ) either just the ones we are still trying or all of them . Note these are the same things that InitiateConnections and ForgetConnections talks about but a method to retrieve Connections would obviously return the current connections .