mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 19:25:51 +00:00
PeerGroup: make selectDownloadPeer non static so users can override it and control selection behaviour.
This commit is contained in:
parent
9e870f40bf
commit
616b4a5a7d
@ -1316,8 +1316,11 @@ public class PeerGroup extends AbstractIdleService {
|
|||||||
long pingTime;
|
long pingTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Given a list of Peers, return a Peer to be used as the download peer. */
|
/**
|
||||||
protected static Peer selectDownloadPeer(List<Peer> peers) {
|
* 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.
|
||||||
|
*/
|
||||||
|
protected Peer selectDownloadPeer(List<Peer> peers) {
|
||||||
// Characteristics to select for in order of importance:
|
// Characteristics to select for in order of importance:
|
||||||
// - Chain height is reasonable (majority of nodes)
|
// - Chain height is reasonable (majority of nodes)
|
||||||
// - High enough protocol version for the features we want (but we'll settle for less)
|
// - High enough protocol version for the features we want (but we'll settle for less)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user