mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-18 14:55:53 -04:00
Add java home path
This commit is contained in:
parent
02d3dd2258
commit
52bdb78990
@ -87,13 +87,13 @@ class MainPM extends PresentationModel<MainModel> {
|
||||
numPendingTrades.bind(model.numPendingTrades);
|
||||
|
||||
model.bootstrapState.addListener((ov, oldValue, newValue) -> {
|
||||
if (newValue == BootstrapState.DISCOVERY_NO_NAT_SUCCEEDED ||
|
||||
if (newValue == BootstrapState.DISCOVERY_DIRECT_SUCCEEDED ||
|
||||
newValue == BootstrapState.DISCOVERY_AUTO_PORT_FORWARDING_SUCCEEDED ||
|
||||
newValue == BootstrapState.RELAY_SUCCEEDED) {
|
||||
bootstrapState.set("Successfully connected to P2P network: " + newValue.getMessage());
|
||||
bootstrapProgress.set(1);
|
||||
|
||||
if (newValue == BootstrapState.DISCOVERY_NO_NAT_SUCCEEDED)
|
||||
if (newValue == BootstrapState.DISCOVERY_DIRECT_SUCCEEDED)
|
||||
bootstrapIconId.set("image-connection-direct");
|
||||
else if (newValue == BootstrapState.DISCOVERY_AUTO_PORT_FORWARDING_SUCCEEDED)
|
||||
bootstrapIconId.set("image-connection-nat");
|
||||
|
@ -80,6 +80,7 @@ class BootstrappedPeerFactory {
|
||||
private final SettableFuture<PeerDHT> settableFuture = SettableFuture.create();
|
||||
|
||||
private final ObjectProperty<BootstrapState> bootstrapState = new SimpleObjectProperty<>();
|
||||
|
||||
private Peer peer;
|
||||
private PeerDHT peerDHT;
|
||||
|
||||
@ -135,7 +136,6 @@ class BootstrappedPeerFactory {
|
||||
}
|
||||
|
||||
peerDHT = new PeerBuilderDHT(peer).start();
|
||||
setState(BootstrapState.PEER_CREATED, "We created a peerDHT.");
|
||||
|
||||
peer.peerBean().peerMap().addPeerMapChangeListener(new PeerMapChangeListener() {
|
||||
@Override
|
||||
@ -197,7 +197,7 @@ class BootstrappedPeerFactory {
|
||||
bootstrap();
|
||||
}
|
||||
else {
|
||||
setState(BootstrapState.DISCOVERY_NO_NAT_SUCCEEDED,
|
||||
setState(BootstrapState.DISCOVERY_DIRECT_SUCCEEDED,
|
||||
"We are not behind a NAT and visible to other peers.");
|
||||
bootstrap();
|
||||
}
|
||||
@ -265,12 +265,10 @@ class BootstrappedPeerFactory {
|
||||
|
||||
private void bootstrap() {
|
||||
FutureBootstrap futureBootstrap = peer.bootstrap().peerAddress(getBootstrapAddress()).start();
|
||||
setState(BootstrapState.BOOT_STRAP_STARTED, "Bootstrap started.");
|
||||
futureBootstrap.addListener(new BaseFutureListener<BaseFuture>() {
|
||||
@Override
|
||||
public void operationComplete(BaseFuture future) throws Exception {
|
||||
if (futureBootstrap.isSuccess()) {
|
||||
setState(BootstrapState.BOOT_STRAP_SUCCEEDED, "Bootstrap successful.");
|
||||
settableFuture.set(peerDHT);
|
||||
}
|
||||
else {
|
||||
|
@ -377,7 +377,7 @@ public class TomP2PNode implements ClientNode {
|
||||
public ConnectionType getConnectionType() {
|
||||
BootstrapState bootstrapState = bootstrappedPeerFactory.getBootstrapState().get();
|
||||
switch (bootstrapState) {
|
||||
case DISCOVERY_NO_NAT_SUCCEEDED:
|
||||
case DISCOVERY_DIRECT_SUCCEEDED:
|
||||
return ConnectionType.DIRECT;
|
||||
case DISCOVERY_MANUAL_PORT_FORWARDING_SUCCEEDED:
|
||||
return ConnectionType.MANUAL_PORT_FORWARDING;
|
||||
|
@ -18,10 +18,9 @@
|
||||
package io.bitsquare.network;
|
||||
|
||||
public enum BootstrapState {
|
||||
PEER_CREATED,
|
||||
PEER_CREATION_FAILED,
|
||||
DISCOVERY_STARTED,
|
||||
DISCOVERY_NO_NAT_SUCCEEDED,
|
||||
DISCOVERY_DIRECT_SUCCEEDED,
|
||||
DISCOVERY_MANUAL_PORT_FORWARDING_SUCCEEDED,
|
||||
DISCOVERY_FAILED,
|
||||
DISCOVERY_AUTO_PORT_FORWARDING_STARTED,
|
||||
@ -30,8 +29,6 @@ public enum BootstrapState {
|
||||
RELAY_STARTED,
|
||||
RELAY_SUCCEEDED,
|
||||
RELAY_FAILED,
|
||||
BOOT_STRAP_STARTED,
|
||||
BOOT_STRAP_SUCCEEDED,
|
||||
BOOT_STRAP_FAILED;
|
||||
|
||||
private String message;
|
||||
|
Loading…
x
Reference in New Issue
Block a user