mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Increase timeouts. Rename TIME_OUT to TIMEOUT.
This commit is contained in:
parent
2ca59a819d
commit
7d14975241
12 changed files with 20 additions and 19 deletions
|
@ -186,7 +186,7 @@ public class WalletConfig extends AbstractIdleService {
|
|||
new InetSocketAddress(socks5Proxy.getInetAddress().getHostName(),
|
||||
socks5Proxy.getPort()));
|
||||
|
||||
int CONNECT_TIMEOUT_MSEC = 60 * 1000; // same value used in bitcoinj.
|
||||
int CONNECT_TIMEOUT_MSEC = 120 * 1000; // 60 used in bitcoinj, but for Tor we allow more.
|
||||
ProxySocketFactory proxySocketFactory = new ProxySocketFactory(proxy);
|
||||
// we dont use tor mode if we have a local node running
|
||||
BlockingClientManager blockingClientManager = bisqEnvironment.isBitcoinLocalhostNodeRunning() ?
|
||||
|
|
|
@ -73,7 +73,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
public class WalletsSetup {
|
||||
private static final Logger log = LoggerFactory.getLogger(WalletsSetup.class);
|
||||
|
||||
private static final long STARTUP_TIMEOUT_SEC = 60;
|
||||
private static final long STARTUP_TIMEOUT_SEC = 120;
|
||||
private final String btcWalletFileName;
|
||||
private static final String BSQ_WALLET_FILE_NAME = "bisq_BSQ.wallet";
|
||||
private static final String SPV_CHAIN_FILE_NAME = "bisq.spvchain";
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
|
|||
public class GetBlocksRequestHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GetBlocksRequestHandler.class);
|
||||
|
||||
private static final long TIME_OUT_SEC = 40;
|
||||
private static final long TIMEOUT_SEC = 60;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -74,7 +74,7 @@ public class GetBlocksRequestHandler {
|
|||
" on connection:" + connection;
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
|
||||
},
|
||||
TIME_OUT_SEC, TimeUnit.SECONDS);
|
||||
TIMEOUT_SEC, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
SettableFuture<Connection> future = networkNode.sendMessage(connection, bsqBlocksResponse);
|
||||
|
|
|
@ -26,7 +26,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||
@Slf4j
|
||||
public class RequestBlocksHandler implements MessageListener {
|
||||
|
||||
private static final long TIME_OUT_SEC = 40;
|
||||
private static final long TIMEOUT_SEC = 60;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -95,7 +95,7 @@ public class RequestBlocksHandler implements MessageListener {
|
|||
"Might be caused by an previous networkNode.sendMessage.onFailure.");
|
||||
}
|
||||
},
|
||||
TIME_OUT_SEC);
|
||||
TIMEOUT_SEC);
|
||||
}
|
||||
|
||||
log.debug("We send a {} to peer {}. ", getBsqBlocksRequest.getClass().getSimpleName(), peersNodeAddress);
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
|
|||
public class OfferAvailabilityProtocol {
|
||||
private static final Logger log = LoggerFactory.getLogger(OfferAvailabilityProtocol.class);
|
||||
|
||||
private static final long TIMEOUT_SEC = 90;
|
||||
private static final long TIMEOUT_SEC = 120;
|
||||
|
||||
private final OfferAvailabilityModel model;
|
||||
private final ResultHandler resultHandler;
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.HashSet;
|
|||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -32,7 +33,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
// Run in UserThread
|
||||
public abstract class NetworkNode implements MessageListener {
|
||||
private static final Logger log = LoggerFactory.getLogger(NetworkNode.class);
|
||||
private static final int CREATE_SOCKET_TIMEOUT_MILLIS = 120000;
|
||||
private static final int CREATE_SOCKET_TIMEOUT_MILLIS = (int) TimeUnit.SECONDS.toMillis(120);
|
||||
|
||||
final int servicePort;
|
||||
private final NetworkProtoResolver networkProtoResolver;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class BroadcastHandler implements PeerManager.Listener {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BroadcastHandler.class);
|
||||
private static final long TIMEOUT_PER_PEER_SEC = 30;
|
||||
private static final long TIMEOUT_PER_PEER_SEC = 60;
|
||||
|
||||
interface ResultHandler {
|
||||
void onCompleted(BroadcastHandler broadcastHandler);
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.stream.Collectors;
|
|||
public class GetDataRequestHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GetDataRequestHandler.class);
|
||||
|
||||
private static final long TIME_OUT_SEC = 60;
|
||||
private static final long TIMEOUT_SEC = 60;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -87,7 +87,7 @@ public class GetDataRequestHandler {
|
|||
" on connection:" + connection;
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
|
||||
},
|
||||
TIME_OUT_SEC, TimeUnit.SECONDS);
|
||||
TIMEOUT_SEC, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
SettableFuture<Connection> future = networkNode.sendMessage(connection, getDataResponse);
|
||||
|
|
|
@ -37,7 +37,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||
class RequestDataHandler implements MessageListener {
|
||||
private static final Logger log = LoggerFactory.getLogger(RequestDataHandler.class);
|
||||
|
||||
private static final long TIME_OUT_SEC = 60;
|
||||
private static final long TIMEOUT_SEC = 60;
|
||||
private NodeAddress peersNodeAddress;
|
||||
|
||||
|
||||
|
@ -120,7 +120,7 @@ class RequestDataHandler implements MessageListener {
|
|||
"Might be caused by an previous networkNode.sendMessage.onFailure.");
|
||||
}
|
||||
},
|
||||
TIME_OUT_SEC);
|
||||
TIMEOUT_SEC);
|
||||
}
|
||||
|
||||
log.info("We send a {} to peer {}. ", getDataRequest.getClass().getSimpleName(), nodeAddress);
|
||||
|
|
|
@ -23,7 +23,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||
class GetPeersRequestHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GetPeersRequestHandler.class);
|
||||
|
||||
private static final long TIME_OUT_SEC = 40;
|
||||
private static final long TIMEOUT_SEC = 60;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -83,7 +83,7 @@ class GetPeersRequestHandler {
|
|||
log.trace("We have stopped already. We ignore that timeoutTimer.run call.");
|
||||
}
|
||||
},
|
||||
TIME_OUT_SEC, TimeUnit.SECONDS);
|
||||
TIMEOUT_SEC, TimeUnit.SECONDS);
|
||||
|
||||
SettableFuture<Connection> future = networkNode.sendMessage(connection,
|
||||
getPeersResponse);
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
|
|||
class PeerExchangeHandler implements MessageListener {
|
||||
private static final Logger log = LoggerFactory.getLogger(PeerExchangeHandler.class);
|
||||
|
||||
private static final long TIME_OUT_SEC = 40;
|
||||
private static final long TIMEOUT_SEC = 60;
|
||||
private static final int DELAY_MS = 1000;
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ class PeerExchangeHandler implements MessageListener {
|
|||
log.trace("We have stopped that handler already. We ignore that timeoutTimer.run call.");
|
||||
}
|
||||
},
|
||||
TIME_OUT_SEC, TimeUnit.SECONDS);
|
||||
TIMEOUT_SEC, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getPeersRequest);
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
@Slf4j
|
||||
class MonitorRequestHandler implements MessageListener {
|
||||
private static final long TIME_OUT_SEC = 120;
|
||||
private static final long TIMEOUT_SEC = 120;
|
||||
private NodeAddress peersNodeAddress;
|
||||
private long requestTs;
|
||||
|
||||
|
@ -109,7 +109,7 @@ class MonitorRequestHandler implements MessageListener {
|
|||
"Might be caused by an previous networkNode.sendMessage.onFailure.");
|
||||
}
|
||||
},
|
||||
TIME_OUT_SEC);
|
||||
TIMEOUT_SEC);
|
||||
|
||||
log.info("We send a {} to peer {}. ", getDataRequest.getClass().getSimpleName(), nodeAddress);
|
||||
networkNode.addMessageListener(this);
|
||||
|
|
Loading…
Add table
Reference in a new issue