mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-18 21:35:03 +01:00
deactivate travis as it does not work anymore with javaFX
This commit is contained in:
parent
b906aa18a5
commit
4d82467fa3
@ -168,9 +168,9 @@ public class OpenOfferManager {
|
|||||||
executor.allowCoreThreadTimeOut(true);
|
executor.allowCoreThreadTimeOut(true);
|
||||||
executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
|
executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
|
||||||
|
|
||||||
checkArgument(Offer.TTL > 60000, "Offer.TTL <= 60");
|
checkArgument(Offer.TTL > 120000, "Offer.TTL <= 120");
|
||||||
long period = Offer.TTL - 120000; // 2 min before TTL expires
|
long period = Offer.TTL - 120000; // 2 min before TTL expires
|
||||||
executor.scheduleAtFixedRate(this::rePublishOffers, 0, period, TimeUnit.SECONDS);
|
executor.scheduleAtFixedRate(this::rePublishOffers, 500, period, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rePublishOffers() {
|
private void rePublishOffers() {
|
||||||
|
@ -348,9 +348,6 @@ public class Connection {
|
|||||||
reportIllegalRequest(IllegalRequest.MaxSizeExceeded);
|
reportIllegalRequest(IllegalRequest.MaxSizeExceeded);
|
||||||
}
|
}
|
||||||
} catch (IOException | ClassNotFoundException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
log.error("Exception at Connection.InputHandler. Connection=" + Connection.this.toString());
|
|
||||||
log.error("Exception=" + e.getMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
inputHandlerStopped = true;
|
inputHandlerStopped = true;
|
||||||
handleConnectionException(e);
|
handleConnectionException(e);
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,7 @@ public class Routing {
|
|||||||
public void broadcast(BroadcastMessage message, @Nullable Address sender) {
|
public void broadcast(BroadcastMessage message, @Nullable Address sender) {
|
||||||
log.trace("Broadcast message to " + connectedNeighbors.values().size() + " neighbors.");
|
log.trace("Broadcast message to " + connectedNeighbors.values().size() + " neighbors.");
|
||||||
log.trace("message = " + message);
|
log.trace("message = " + message);
|
||||||
|
log.trace("connectedNeighbors = " + connectedNeighbors);
|
||||||
connectedNeighbors.values().parallelStream()
|
connectedNeighbors.values().parallelStream()
|
||||||
.filter(e -> !e.address.equals(sender))
|
.filter(e -> !e.address.equals(sender))
|
||||||
.forEach(neighbor -> {
|
.forEach(neighbor -> {
|
||||||
@ -369,9 +370,9 @@ public class Routing {
|
|||||||
public void onSuccess(Connection connection) {
|
public void onSuccess(Connection connection) {
|
||||||
log.trace("GetNeighborsMessage sent successfully from " + getAddress() + " to " + peerAddress);
|
log.trace("GetNeighborsMessage sent successfully from " + getAddress() + " to " + peerAddress);
|
||||||
|
|
||||||
// we wait to get the success to reduce the time span of the moment of
|
/* // we wait to get the success to reduce the time span of the moment of
|
||||||
// authentication at both sides of the connection
|
// authentication at both sides of the connection
|
||||||
setAuthenticated(connection, peerAddress);
|
setAuthenticated(connection, peerAddress);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -392,7 +393,7 @@ public class Routing {
|
|||||||
setAuthenticated(connection, peerAddress);
|
setAuthenticated(connection, peerAddress);
|
||||||
purgeReportedNeighbors();
|
purgeReportedNeighbors();
|
||||||
SettableFuture<Connection> future = networkNode.sendMessage(peerAddress,
|
SettableFuture<Connection> future = networkNode.sendMessage(peerAddress,
|
||||||
new NeighborsMessage(getAllNeighborAddresses()));
|
new NeighborsMessage(getAddress(), getAllNeighborAddresses()));
|
||||||
log.trace("sent NeighborsMessage to " + peerAddress + " from " + getAddress()
|
log.trace("sent NeighborsMessage to " + peerAddress + " from " + getAddress()
|
||||||
+ " with allNeighbors=" + getAllNeighborAddresses());
|
+ " with allNeighbors=" + getAllNeighborAddresses());
|
||||||
Futures.addCallback(future, new FutureCallback<Connection>() {
|
Futures.addCallback(future, new FutureCallback<Connection>() {
|
||||||
@ -417,7 +418,8 @@ public class Routing {
|
|||||||
}
|
}
|
||||||
} else if (message instanceof NeighborsMessage) {
|
} else if (message instanceof NeighborsMessage) {
|
||||||
log.trace("NeighborsMessage from " + connection.getPeerAddress() + " at " + getAddress());
|
log.trace("NeighborsMessage from " + connection.getPeerAddress() + " at " + getAddress());
|
||||||
ArrayList<Address> neighborAddresses = ((NeighborsMessage) message).neighborAddresses;
|
NeighborsMessage neighborsMessage = (NeighborsMessage) message;
|
||||||
|
ArrayList<Address> neighborAddresses = neighborsMessage.neighborAddresses;
|
||||||
log.trace("Received neighbors: " + neighborAddresses);
|
log.trace("Received neighbors: " + neighborAddresses);
|
||||||
// remove ourselves
|
// remove ourselves
|
||||||
neighborAddresses.remove(getAddress());
|
neighborAddresses.remove(getAddress());
|
||||||
@ -427,6 +429,10 @@ public class Routing {
|
|||||||
+ " authenticated (" + connection.getObjectId() + "). Took "
|
+ " authenticated (" + connection.getObjectId() + "). Took "
|
||||||
+ (System.currentTimeMillis() - startAuthTs) + " ms. \n\n");
|
+ (System.currentTimeMillis() - startAuthTs) + " ms. \n\n");
|
||||||
|
|
||||||
|
// we wait until the handshake is completed before setting the authenticate flag
|
||||||
|
// authentication at both sides of the connection
|
||||||
|
setAuthenticated(connection, neighborsMessage.address);
|
||||||
|
|
||||||
Runnable authenticationCompleteHandler = authenticationCompleteHandlers.remove(connection.getPeerAddress());
|
Runnable authenticationCompleteHandler = authenticationCompleteHandlers.remove(connection.getPeerAddress());
|
||||||
if (authenticationCompleteHandler != null)
|
if (authenticationCompleteHandler != null)
|
||||||
authenticationCompleteHandler.run();
|
authenticationCompleteHandler.run();
|
||||||
@ -461,11 +467,21 @@ public class Routing {
|
|||||||
|
|
||||||
private List<Address> getNotConnectedNeighborAddresses() {
|
private List<Address> getNotConnectedNeighborAddresses() {
|
||||||
ArrayList<Address> reportedNeighborsList = new ArrayList<>(getAllNeighborAddresses());
|
ArrayList<Address> reportedNeighborsList = new ArrayList<>(getAllNeighborAddresses());
|
||||||
|
log.debug("## getNotConnectedNeighborAddresses ");
|
||||||
|
log.debug("## reportedNeighborsList=" + reportedNeighborsList);
|
||||||
connectedNeighbors.values().stream().forEach(e -> reportedNeighborsList.remove(e.address));
|
connectedNeighbors.values().stream().forEach(e -> reportedNeighborsList.remove(e.address));
|
||||||
|
log.debug("## connectedNeighbors=" + connectedNeighbors);
|
||||||
|
log.debug("## reportedNeighborsList=" + reportedNeighborsList);
|
||||||
return reportedNeighborsList;
|
return reportedNeighborsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void authenticateToNextRandomNeighbor() {
|
private void authenticateToNextRandomNeighbor() {
|
||||||
|
executorService.submit(() -> {
|
||||||
|
try {
|
||||||
|
Thread.sleep(new Random().nextInt(200) + 200);
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
if (getConnectedNeighbors().size() <= MAX_CONNECTIONS) {
|
if (getConnectedNeighbors().size() <= MAX_CONNECTIONS) {
|
||||||
Address randomNotConnectedNeighborAddress = getRandomNotConnectedNeighborAddress();
|
Address randomNotConnectedNeighborAddress = getRandomNotConnectedNeighborAddress();
|
||||||
if (randomNotConnectedNeighborAddress != null) {
|
if (randomNotConnectedNeighborAddress != null) {
|
||||||
@ -477,6 +493,7 @@ public class Routing {
|
|||||||
} else {
|
} else {
|
||||||
log.info("We have already enough connections.");
|
log.info("We have already enough connections.");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void authenticateToPeer(Address address, @Nullable Runnable authenticationCompleteHandler, @Nullable Runnable faultHandler) {
|
public void authenticateToPeer(Address address, @Nullable Runnable authenticationCompleteHandler, @Nullable Runnable faultHandler) {
|
||||||
|
@ -9,9 +9,11 @@ public final class NeighborsMessage implements AuthenticationMessage {
|
|||||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||||
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
|
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
|
||||||
|
|
||||||
|
public final Address address;
|
||||||
public final ArrayList<Address> neighborAddresses;
|
public final ArrayList<Address> neighborAddresses;
|
||||||
|
|
||||||
public NeighborsMessage(ArrayList<Address> neighborAddresses) {
|
public NeighborsMessage(Address address, ArrayList<Address> neighborAddresses) {
|
||||||
|
this.address = address;
|
||||||
this.neighborAddresses = neighborAddresses;
|
this.neighborAddresses = neighborAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user