From 28edc0bf60758c8ec25deeb58908a01dd42ef127 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Tue, 11 Nov 2014 02:56:28 +0100 Subject: [PATCH] Deactivate success check for GetPeerAddress, User baseFuture.isSuccess() --- .../bitsquare/msg/tomp2p/TomP2PMessageFacade.java | 13 ++++++++----- .../io/bitsquare/util/tomp2p/BaseFutureUtil.java | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageFacade.java b/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageFacade.java index 4be38ec5a4..6a3122b63a 100644 --- a/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageFacade.java +++ b/src/main/java/io/bitsquare/msg/tomp2p/TomP2PMessageFacade.java @@ -116,13 +116,15 @@ class TomP2PMessageFacade implements MessageFacade { futureGet.addListener(new BaseFutureAdapter() { @Override public void operationComplete(BaseFuture baseFuture) throws Exception { - if (isSuccess(baseFuture) && futureGet.data() != null) { - final Peer peer = (Peer) futureGet.data().object(); - Platform.runLater(() -> listener.onResult(peer)); - } + //TODO just deactivated temporary because in relay mode with 2 local peers isSuccess returns false + //if (isSuccess(baseFuture) && futureGet.data() != null) { + final Peer peer = (Peer) futureGet.data().object(); + Platform.runLater(() -> listener.onResult(peer)); + /* } else { + log.error("getPeerAddress failed. failedReason = " + baseFuture.failedReason()); Platform.runLater(listener::onFailed); - } + }*/ } }); } @@ -144,6 +146,7 @@ class TomP2PMessageFacade implements MessageFacade { Platform.runLater(listener::onResult); } else { + log.error("sendMessage failed with reason " + futureDirect.failedReason()); Platform.runLater(listener::onFailed); } } diff --git a/src/main/java/io/bitsquare/util/tomp2p/BaseFutureUtil.java b/src/main/java/io/bitsquare/util/tomp2p/BaseFutureUtil.java index fd11371e1e..5da1301594 100644 --- a/src/main/java/io/bitsquare/util/tomp2p/BaseFutureUtil.java +++ b/src/main/java/io/bitsquare/util/tomp2p/BaseFutureUtil.java @@ -23,7 +23,6 @@ public class BaseFutureUtil { // Isolate the success handling as there is bug in port forwarding mode public static boolean isSuccess(BaseFuture baseFuture) { - // return baseFuture.isSuccess(); - return true; + return baseFuture.isSuccess(); } }