mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
ForwardingService: limit the number of peer connections required
Nowadays on testnet or signet it takes a long time to discover enough bloom-enabled peers.
This commit is contained in:
parent
50f46651b4
commit
691cd46267
1 changed files with 2 additions and 0 deletions
|
@ -42,6 +42,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
public class ForwardingService {
|
public class ForwardingService {
|
||||||
static final String usage = "Usage: address-to-send-back-to [mainnet|testnet|signet|regtest]";
|
static final String usage = "Usage: address-to-send-back-to [mainnet|testnet|signet|regtest]";
|
||||||
static final int requiredConfirmations = 1;
|
static final int requiredConfirmations = 1;
|
||||||
|
static final int MAX_CONNECTIONS = 4;
|
||||||
private final BitcoinNetwork network;
|
private final BitcoinNetwork network;
|
||||||
private final Address forwardingAddress;
|
private final Address forwardingAddress;
|
||||||
private final WalletAppKit kit;
|
private final WalletAppKit kit;
|
||||||
|
@ -118,6 +119,7 @@ public class ForwardingService {
|
||||||
// Download the blockchain and wait until it's done.
|
// Download the blockchain and wait until it's done.
|
||||||
kit.startAsync();
|
kit.startAsync();
|
||||||
kit.awaitRunning();
|
kit.awaitRunning();
|
||||||
|
kit.peerGroup().setMaxConnections(MAX_CONNECTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue