mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 11:15:51 +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);
|
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.
|
// Internal version.
|
||||||
@Nullable
|
@Nullable
|
||||||
protected Peer connectTo(PeerAddress address, boolean incrementMaxConnections) {
|
protected Peer connectTo(PeerAddress address, boolean incrementMaxConnections) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user