Skip to content

Commit

Permalink
BuildCheckpoints: Testnet requires fewer connections
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Jul 6, 2021
1 parent 5ce82ab commit 0101551
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/src/main/java/org/bitcoinj/tools/BuildCheckpoints.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

import static com.google.common.base.Preconditions.checkState;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.bitcoinj.tools.NetworkEnum.TEST;

/**
* Downloads and verifies a full chain from your local peer, emitting checkpoints at each difficulty transition period
Expand Down Expand Up @@ -116,7 +117,11 @@ public static void main(String[] args) throws Exception {
} else if (networkHasDnsSeeds) {
// for PROD and TEST use a peer group discovered with dns
peerGroup.setUserAgent("PeerMonitor", "1.0");
peerGroup.setMaxConnections(20);
if (netFlag.value(options) == TEST) {
peerGroup.setMaxConnections(6);
} else {
peerGroup.setMaxConnections(20);
}
peerGroup.addPeerDiscovery(new DnsDiscovery(params));
peerGroup.start();

Expand Down

0 comments on commit 0101551

Please sign in to comment.