func (l *PeerList) SetStrategy(sc ScoreCalculator) {
	l.Lock()
	defer l.Unlock()

	l.scoreCalculator = sc
	for _, ps := range l.peersByHostPort {
		newScore := l.scoreCalculator.GetScore(ps.Peer)
		l.updatePeer(ps, newScore)
	}
}
func (l *PeerList) SetStrategy(sc ScoreCalculator) {
	l.Lock()
	defer l.Unlock()

	l.scoreCalculator = sc
	for _, ps := range l.peersByHostPort {
		newScore := l.scoreCalculator.GetScore(ps.Peer)
		l.updatePeer(ps, newScore)
	}
}
func ( l * PeerList ) SetStrategy ( sc ScoreCalculator ) { l . Lock ( ) defer l . Unlock ( ) l . scoreCalculator = sc for _ , ps := range l . peersByHostPort { newScore := l . scoreCalculator . GetScore ( ps . Peer ) l . updatePeer ( ps , newScore ) } }
// SetStrategy sets customized peer selection strategy.
SetStrategy sets customized peer selection strategy .