question: @ Nullable protected Peer selectDownloadPeer ( List < Peer > peers ) { if ( peers . isEmpty ( ) ) return null ; int mostCommonChainHeight = getMostCommonChainHeight ( peers ) ; List < Peer > candidates = new ArrayList < Peer > ( ) ; for ( Peer peer : peers ) { if ( peer . getBestHeight ( ) == mostCommonChainHeight ) candidates . add ( peer ) ; } int highestVersion = 0 , preferredVersion = 0 ; final int PREFERRED_VERSION = params . getProtocolVersionNum ( NetworkParameters . ProtocolVersion . BLOOM_FILTER ) ; for ( Peer peer : candidates ) { highestVersion = Math . max ( peer . getPeerVersionMessage ( ) . clientVersion , highestVersion ) ; preferredVersion = Math . min ( highestVersion , PREFERRED_VERSION ) ; } ArrayList < Peer > candidates2 = new ArrayList < Peer > ( candidates . size ( ) ) ; for ( Peer peer : candidates ) { if ( peer . getPeerVersionMessage ( ) . clientVersion >= preferredVersion ) { candidates2 . add ( peer ) ; } } int index = ( int ) ( Math . random ( ) * candidates2 . size ( ) ) ; return candidates2 . get ( index ) ; }
target:  Given a list of Peers, return a Peer to be used as the download peer. If you don't want PeerGroup to manage download peer statuses for you, just override this and always return null.