mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-18 23:06:02 -04:00
Disable relay mode
This commit is contained in:
parent
eee523e8b3
commit
dd80d3edf3
@ -46,7 +46,6 @@ import net.tomp2p.futures.BaseFutureListener;
|
||||
import net.tomp2p.futures.FutureBootstrap;
|
||||
import net.tomp2p.futures.FutureDiscover;
|
||||
import net.tomp2p.nat.FutureNAT;
|
||||
import net.tomp2p.nat.FutureRelayNAT;
|
||||
import net.tomp2p.nat.PeerBuilderNAT;
|
||||
import net.tomp2p.nat.PeerNAT;
|
||||
import net.tomp2p.p2p.Peer;
|
||||
@ -188,9 +187,10 @@ class BootstrappedPeerFactory {
|
||||
lastSuccessfulBootstrap = BootstrapState.DIRECT_SUCCESS;
|
||||
|
||||
switch (lastSuccessfulBootstrap) {
|
||||
case RELAY_SUCCESS:
|
||||
// For the moment we don't support relay mode as it has too much problems
|
||||
/* case RELAY_SUCCESS:
|
||||
bootstrapWithRelay();
|
||||
break;
|
||||
break;*/
|
||||
case AUTO_PORT_FORWARDING_SUCCESS:
|
||||
tryPortForwarding();
|
||||
break;
|
||||
@ -260,9 +260,16 @@ class BootstrappedPeerFactory {
|
||||
discoverAfterPortForwarding();
|
||||
}
|
||||
else {
|
||||
setState(BootstrapState.AUTO_PORT_FORWARDING_NOT_SUCCEEDED, "Port forwarding has failed. " +
|
||||
handleError(BootstrapState.AUTO_PORT_FORWARDING_FAILED, "Automatic port forwarding failed. " +
|
||||
"Fail reason: " + future.failedReason() +
|
||||
"\nCheck if UPnP is not enabled on your router. " +
|
||||
"\nYou can try also to setup manual port forwarding. " +
|
||||
"\nRelay mode is currently not supported but will follow later. ");
|
||||
|
||||
// For the moment we don't support relay mode as it has too much problems
|
||||
/* setState(BootstrapState.AUTO_PORT_FORWARDING_NOT_SUCCEEDED, "Port forwarding has failed. " +
|
||||
"We try to use a relay as next step.");
|
||||
bootstrapWithRelay();
|
||||
bootstrapWithRelay();*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,7 +293,8 @@ class BootstrappedPeerFactory {
|
||||
bootstrap(BootstrapState.AUTO_PORT_FORWARDING_SUCCESS);
|
||||
}
|
||||
else {
|
||||
handleError(BootstrapState.AUTO_PORT_FORWARDING_FAILED, "Discover with automatic port forwarding has failed " +
|
||||
handleError(BootstrapState.AUTO_PORT_FORWARDING_FAILED, "Discover with automatic port forwarding " +
|
||||
"has failed " +
|
||||
futureDiscover.failedReason());
|
||||
}
|
||||
}
|
||||
@ -298,8 +306,9 @@ class BootstrappedPeerFactory {
|
||||
});
|
||||
}
|
||||
|
||||
// For the moment we don't support relay mode as it has too much problems
|
||||
// 3. Attempt: We try to use another peer as relay
|
||||
private void bootstrapWithRelay() {
|
||||
/* private void bootstrapWithRelay() {
|
||||
setState(BootstrapState.RELAY_INIT, "We try to use another peer as relay.");
|
||||
FutureDiscover futureDiscover = peer.discover().peerAddress(getBootstrapAddress()).start();
|
||||
PeerNAT peerNAT = new PeerBuilderNAT(peer).start();
|
||||
@ -323,7 +332,7 @@ class BootstrappedPeerFactory {
|
||||
handleError(BootstrapState.RELAY_FAILED, "Exception at bootstrapWithRelay: " + t.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
private void bootstrap(BootstrapState state) {
|
||||
FutureBootstrap futureBootstrap = peer.bootstrap().peerAddress(getBootstrapAddress()).start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user