Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use EvoNodes if there are not enough masternodes #1230

Merged
merged 6 commits into from
Dec 28, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.bitcoinj.core.CheckpointManager;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.FilteredBlock;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Peer;
import org.bitcoinj.core.PeerGroup;
import org.bitcoinj.core.Sha256Hash;
Expand Down Expand Up @@ -709,6 +710,13 @@ public InetSocketAddress[] getPeers(final long services, final long timeoutValue
log.info("DMN peer discovery returned less than 16 nodes. Adding default DMN peers to the list to increase connections");
MasternodePeerDiscovery discovery = new MasternodePeerDiscovery(defaultMNList, Constants.NETWORK_PARAMETERS.getPort());
peers.addAll(Arrays.asList(discovery.getPeers(services, timeoutValue, timeoutUnit)));

// use EvoNodes if the network is small
if (peers.size() < MINIMUM_PEER_COUNT) {
String [] defaultEvoNodeList = Constants.NETWORK_PARAMETERS.getDefaultHPMasternodeList();
MasternodePeerDiscovery discoveryEvo = new MasternodePeerDiscovery(defaultEvoNodeList, Constants.NETWORK_PARAMETERS.getPort());
peers.addAll(Arrays.asList(discoveryEvo.getPeers(services, timeoutValue, timeoutUnit)));
}
} else {
log.info("DNS peer discovery returned less than 16 nodes. Unable to add seed peers (it is not specified for this network).");
}
Expand Down
Loading