vPeerGroup.addPeerDiscovery(hardCodedPeers);
vPeerGroup.setMaxConnections(2);
vPeerGroup.setConnectTimeoutMillis(10000);
// Sequence things so we *always* get both hard-coded peers for now.
vPeerGroup.waitForPeersOfVersion(2, GetUTXOsMessage.MIN_PROTOCOL_VERSION).addListener(() -> {
vPeerGroup.addPeerDiscovery(new DnsDiscovery(params));
vPeerGroup.setMaxConnections(6);
}, Threading.SAME_THREAD);
}
vPeerGroup.addEventListener(new AbstractPeerEventListener() {