mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 14:54:15 +00:00
Add a PeerGroup.connectToLocalhost helper method.
This commit is contained in:
parent
4df728a7d9
commit
28c16738bc
@ -956,6 +956,16 @@ public class PeerGroup extends AbstractExecutionThreadService implements Transac
|
||||
return connectTo(peerAddress, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for forcing a connection to localhost. Useful when using regtest mode. Returns the peer object.
|
||||
*/
|
||||
@Nullable
|
||||
public Peer connectToLocalHost() {
|
||||
final PeerAddress localhost = PeerAddress.localhost(params);
|
||||
backoffMap.put(localhost, new ExponentialBackoff(peerBackoffParams));
|
||||
return connectTo(localhost, true);
|
||||
}
|
||||
|
||||
// Internal version.
|
||||
@Nullable
|
||||
protected Peer connectTo(PeerAddress address, boolean incrementMaxConnections) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user