Merge branch 'UI-improvements' into feature/show-tooltip-if-truncated

# Conflicts:
#	gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java
#	gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java
This commit is contained in:
Christoph Atteneder 2017-12-21 10:12:30 +01:00
commit f3b638078b
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
83 changed files with 792 additions and 812 deletions

View file

@ -17,14 +17,12 @@
package io.bisq.common.app;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
public class Version {
private static final Logger log = LoggerFactory.getLogger(Version.class);
// The application versions
// VERSION = 0.5.0 introduces proto buffer for the P2P network and local DB and is a not backward compatible update
// Therefore all sub versions start again with 1

View file

@ -230,10 +230,10 @@ mainView.footer.btcInfo.connectingTo=connecting to
mainView.footer.btcInfo.connectionFailed=connection failed
mainView.footer.p2pInfo= P2P network peers: {0}
mainView.bootstrapState.connectionToTorNetwork=Connecting to Tor network...
mainView.bootstrapState.torNodeCreated=Tor node created
mainView.bootstrapState.hiddenServicePublished=Hidden Service published
mainView.bootstrapState.initialDataReceived=Initial data received
mainView.bootstrapState.connectionToTorNetwork=(1/4) Connecting to Tor network...
mainView.bootstrapState.torNodeCreated=(2/4) Tor node created
mainView.bootstrapState.hiddenServicePublished=(3/4) Hidden Service published
mainView.bootstrapState.initialDataReceived=(4/4) Initial data received
mainView.bootstrapWarning.noSeedNodesAvailable=No seed nodes available
mainView.bootstrapWarning.noNodesAvailable=No seed nodes and peers available

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=verbinde mit
mainView.footer.btcInfo.connectionFailed=Verbindung fehlgeschlagen
mainView.footer.p2pInfo= P2P-Netzwerk-Peers: {0}
mainView.bootstrapState.connectionToTorNetwork=Verbindung mit Tor-Netzwerk wird hergestellt...
mainView.bootstrapState.torNodeCreated=Tor-Knoten erstellt
mainView.bootstrapState.hiddenServicePublished=Hidden Service veröffentlicht
mainView.bootstrapState.initialDataReceived=Anfangsdaten erhalten
mainView.bootstrapState.connectionToTorNetwork=(1/4) Verbindung mit Tor-Netzwerk wird hergestellt...
mainView.bootstrapState.torNodeCreated=(2/4) Tor-Knoten erstellt
mainView.bootstrapState.hiddenServicePublished=(3/4) Hidden Service veröffentlicht
mainView.bootstrapState.initialDataReceived=(4/4) Anfangsdaten erhalten
mainView.bootstrapWarning.noSeedNodesAvailable=Keine Seed-Knoten verfügbar
mainView.bootstrapWarning.noNodesAvailable=Keine Seed-Knoten und Peers verfügbar

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=σύνδεση με
mainView.footer.btcInfo.connectionFailed=σύνδεση απέτυχε
mainView.footer.p2pInfo= P2P network peers: {0}
mainView.bootstrapState.connectionToTorNetwork=Σύνδεση με δίκτυο Tor...
mainView.bootstrapState.torNodeCreated=Κόμβος Tor δημιουργήθηκε
mainView.bootstrapState.hiddenServicePublished=Κοινοποίηση κρυφής υπηρεσίας
mainView.bootstrapState.initialDataReceived=Αρχικά δεδομένα ελήφθησαν
mainView.bootstrapState.connectionToTorNetwork=(1/4) Σύνδεση με δίκτυο Tor...
mainView.bootstrapState.torNodeCreated=(2/4) Κόμβος Tor δημιουργήθηκε
mainView.bootstrapState.hiddenServicePublished=(3/4) Κοινοποίηση κρυφής υπηρεσίας
mainView.bootstrapState.initialDataReceived=(4/4) Αρχικά δεδομένα ελήφθησαν
mainView.bootstrapWarning.noSeedNodesAvailable=Δεν υπάρχουν διαθέσιμοι seed κόμβοι
mainView.bootstrapWarning.noNodesAvailable=Δεν υπάρχουν διαθέσιμοι seed κόμβοι και peers

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=Conectando a
mainView.footer.btcInfo.connectionFailed=Conexión fallida
mainView.footer.p2pInfo= Pares de red P2P: {0}
mainView.bootstrapState.connectionToTorNetwork=Conectando a la red Tor...
mainView.bootstrapState.torNodeCreated=Nodo Tor creado
mainView.bootstrapState.hiddenServicePublished=Servicio Escondido publicado
mainView.bootstrapState.initialDataReceived=Datos iniciales recibidos.
mainView.bootstrapState.connectionToTorNetwork=(1/4) Conectando a la red Tor...
mainView.bootstrapState.torNodeCreated=(2/4) Nodo Tor creado
mainView.bootstrapState.hiddenServicePublished=(3/4) Servicio Escondido publicado
mainView.bootstrapState.initialDataReceived=(4/4) Datos iniciales recibidos.
mainView.bootstrapWarning.noSeedNodesAvailable=No hay nodos de siembra disponibles
mainView.bootstrapWarning.noNodesAvailable=No hay nodos de sembrado y pares disponibles

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=csatlakozás
mainView.footer.btcInfo.connectionFailed=sikeretlen kapcsolat
mainView.footer.p2pInfo= P2P hálózat társak: {0}
mainView.bootstrapState.connectionToTorNetwork=Csatlakozás Tor hálózathoz...
mainView.bootstrapState.torNodeCreated=Tor csomópont létrehozva
mainView.bootstrapState.hiddenServicePublished=Rejtett Szolgáltatás megjelentve
mainView.bootstrapState.initialDataReceived=Kezdeti adatok megérkezve
mainView.bootstrapState.connectionToTorNetwork=(1/4) Csatlakozás Tor hálózathoz...
mainView.bootstrapState.torNodeCreated=(2/4) Tor csomópont létrehozva
mainView.bootstrapState.hiddenServicePublished=(3/4) Rejtett Szolgáltatás megjelentve
mainView.bootstrapState.initialDataReceived=(4/4) Kezdeti adatok megérkezve
mainView.bootstrapWarning.noSeedNodesAvailable=Nincs elérhető mag csomópont
mainView.bootstrapWarning.noNodesAvailable=Nincs elérhető mag és társ csomópont

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=conectando à
mainView.footer.btcInfo.connectionFailed=falha na conexão
mainView.footer.p2pInfo= Pares na rede P2P: {0}
mainView.bootstrapState.connectionToTorNetwork=Conectando à rede Tor....
mainView.bootstrapState.torNodeCreated=Nó da rede Tor criado
mainView.bootstrapState.hiddenServicePublished=Serviço Oculto publicado
mainView.bootstrapState.initialDataReceived=Dados iniciais recebidos
mainView.bootstrapState.connectionToTorNetwork=(1/4) Conectando à rede Tor....
mainView.bootstrapState.torNodeCreated=(2/4) Nó da rede Tor criado
mainView.bootstrapState.hiddenServicePublished=(3/4) Serviço Oculto publicado
mainView.bootstrapState.initialDataReceived=(4/4) Dados iniciais recebidos
mainView.bootstrapWarning.noSeedNodesAvailable=Nenhum nó semente disponível
mainView.bootstrapWarning.noNodesAvailable=Sem nós semente e pares disponíveis

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=conectare la
mainView.footer.btcInfo.connectionFailed=conectare eșuată
mainView.footer.p2pInfo= Semeni de rețea P2P: {0}
mainView.bootstrapState.connectionToTorNetwork=Conectare la rețeaua Tor...
mainView.bootstrapState.torNodeCreated=Nod Tor creat
mainView.bootstrapState.hiddenServicePublished=Serviciu ascuns publicat
mainView.bootstrapState.initialDataReceived=Date inițiale primite
mainView.bootstrapState.connectionToTorNetwork=(1/4) Conectare la rețeaua Tor...
mainView.bootstrapState.torNodeCreated=(2/4) Nod Tor creat
mainView.bootstrapState.hiddenServicePublished=(3/4) Serviciu ascuns publicat
mainView.bootstrapState.initialDataReceived=(4/4) Date inițiale primite
mainView.bootstrapWarning.noSeedNodesAvailable=Nu există noduri nucleu disponibile
mainView.bootstrapWarning.noNodesAvailable=Nu există semeni și noduri nucleu disponibile

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=соединение с
mainView.footer.btcInfo.connectionFailed=соединение неудачно
mainView.footer.p2pInfo= Участников P2P сети: {0}
mainView.bootstrapState.connectionToTorNetwork=Соединение с сетью Tor...
mainView.bootstrapState.torNodeCreated=Создан узел Tor
mainView.bootstrapState.hiddenServicePublished=Скрытая служба опубликовала
mainView.bootstrapState.initialDataReceived=Начальные данные получены
mainView.bootstrapState.connectionToTorNetwork=(1/4) Соединение с сетью Tor...
mainView.bootstrapState.torNodeCreated=(2/4) Создан узел Tor
mainView.bootstrapState.hiddenServicePublished=(3/4) Скрытая служба опубликовала
mainView.bootstrapState.initialDataReceived=(4/4) Начальные данные получены
mainView.bootstrapWarning.noSeedNodesAvailable=Нет доступных узлов.
mainView.bootstrapWarning.noNodesAvailable=Нет доступных узлов и участников

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=povezivanje sa
mainView.footer.btcInfo.connectionFailed=veza nije uspostavljena
mainView.footer.p2pInfo= Pirovi P2P mreže: {0}
mainView.bootstrapState.connectionToTorNetwork=Povezivanje sa Tor mrežom...
mainView.bootstrapState.torNodeCreated=Tor noda napravljena
mainView.bootstrapState.hiddenServicePublished=Skriven Servis objavljen
mainView.bootstrapState.initialDataReceived=Inicijalni podaci primljeni
mainView.bootstrapState.connectionToTorNetwork=(1/4) Povezivanje sa Tor mrežom...
mainView.bootstrapState.torNodeCreated=(2/4) Tor noda napravljena
mainView.bootstrapState.hiddenServicePublished=(3/4) Skriven Servis objavljen
mainView.bootstrapState.initialDataReceived=(4/4) Inicijalni podaci primljeni
mainView.bootstrapWarning.noSeedNodesAvailable=Sid node nisu dostupne
mainView.bootstrapWarning.noNodesAvailable=Sid node i pirovi nisu dostupni

View file

@ -226,10 +226,10 @@ mainView.footer.btcInfo.connectingTo=连接至
mainView.footer.btcInfo.connectionFailed=连接失败
mainView.footer.p2pInfo= P2P 网络节点: {0}
mainView.bootstrapState.connectionToTorNetwork=连接至 Tor 网络...
mainView.bootstrapState.torNodeCreated=Tor 节点已创建
mainView.bootstrapState.hiddenServicePublished=隐藏的服务已发布
mainView.bootstrapState.initialDataReceived=初始数据已接收
mainView.bootstrapState.connectionToTorNetwork=(1/4) 连接至 Tor 网络...
mainView.bootstrapState.torNodeCreated=(2/4) Tor 节点已创建
mainView.bootstrapState.hiddenServicePublished=(3/4) 隐藏的服务已发布
mainView.bootstrapState.initialDataReceived=(4/4) 初始数据已接收
mainView.bootstrapWarning.noSeedNodesAvailable=没有可用的种子节点
mainView.bootstrapWarning.noNodesAvailable=没有可用的种子节点和节点

View file

@ -414,10 +414,10 @@ mainView.footer.btcInfo.synchronizedWith=Synchronisé avec
mainView.footer.btcInfo.connectingTo=Connexion à
mainView.footer.btcInfo.connectionFailed=Échec de la connexion
mainView.footer.p2pInfo=Pairs de réseau P2P: {0}
mainView.bootstrapState.connectionToTorNetwork=Connexion au réseau Tor...
mainView.bootstrapState.torNodeCreated=Noeud Tor créé
mainView.bootstrapState.hiddenServicePublished=Service caché publié
mainView.bootstrapState.initialDataReceived=Données initiales reçues
mainView.bootstrapState.connectionToTorNetwork=(1/4) Connexion au réseau Tor...
mainView.bootstrapState.torNodeCreated=(2/4) Noeud Tor créé
mainView.bootstrapState.hiddenServicePublished=(3/4) Service caché publié
mainView.bootstrapState.initialDataReceived=(4/4) Données initiales reçues
mainView.bootstrapWarning.noSeedNodesAvailable=Aucun nœud d'initialisation disponible
mainView.bootstrapWarning.noNodesAvailable=Aucun nœud d'initialisation ou de pair persistant n'est disponible
mainView.bootstrapWarning.bootstrappingToP2PFailed=Le démarrage du réseau P2P a échoué

View file

@ -272,10 +272,10 @@ public class BisqEnvironment extends StandardEnvironment {
"Bisq";
useAllProvidedNodes = commandLineProperties.containsProperty(BtcOptionKeys.USE_ALL_PROVIDED_NODES) ?
(String) commandLineProperties.getProperty(BtcOptionKeys.USE_ALL_PROVIDED_NODES) :
"";
"false";
numConnectionForBtc = commandLineProperties.containsProperty(BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC) ?
(String) commandLineProperties.getProperty(BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC) :
"8";
"9";
MutablePropertySources propertySources = this.getPropertySources();
propertySources.addFirst(commandLineProperties);

View file

@ -160,7 +160,7 @@ public abstract class BisqExecutable {
description("User agent at btc node connections", ""))
.withRequiredArg();
parser.accepts(BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC,
description("Number of connections to the Bitcoin network", "8"))
description("Number of connections to the Bitcoin network", "9"))
.withRequiredArg();

View file

@ -57,6 +57,7 @@ import static com.google.common.base.Preconditions.*;
// Does the basic wiring
@Slf4j
public class WalletConfig extends AbstractIdleService {
private static int TIMEOUT = 120 * 1000; // connectTimeoutMillis. 60 sec used in bitcoinj, but for Tor we allow more.
///////////////////////////////////////////////////////////////////////////////////////////
// WalletFactory
@ -190,7 +191,6 @@ public class WalletConfig extends AbstractIdleService {
new InetSocketAddress(socks5Proxy.getInetAddress().getHostName(),
socks5Proxy.getPort()));
int TIMEOUT = 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() ?

View file

@ -71,8 +71,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
// merge WalletsSetup with WalletConfig to one class.
@Slf4j
public class WalletsSetup {
// We reduce defaultConnections from 12 (PeerGroup.DEFAULT_CONNECTIONS) to 8 nodes
private static final int DEFAULT_CONNECTIONS = 8;
// We reduce defaultConnections from 12 (PeerGroup.DEFAULT_CONNECTIONS) to 9 nodes
private static final int DEFAULT_CONNECTIONS = 9;
private static final long STARTUP_TIMEOUT = 180;
private final String btcWalletFileName;

View file

@ -13,16 +13,13 @@ import io.bisq.core.dao.blockchain.vo.BsqBlock;
import io.bisq.network.p2p.network.CloseConnectionReason;
import io.bisq.network.p2p.network.Connection;
import io.bisq.network.p2p.network.NetworkNode;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
@Slf4j
public class GetBlocksRequestHandler {
private static final Logger log = LoggerFactory.getLogger(GetBlocksRequestHandler.class);
private static final long TIMEOUT = 120;

View file

@ -25,7 +25,6 @@ import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
public class RequestBlocksHandler implements MessageListener {
private static final long TIMEOUT = 120;

View file

@ -94,7 +94,6 @@ public class CoreSeedNodesRepository implements SeedNodesRepository {
new NodeAddress("rm7b56wbrcczpjvl.onion:8000"), // @manfredkarrer
new NodeAddress("fl3mmribyxgrv63c.onion:8000"), // @manfredkarrer
//TODO dev
// local dev
// new NodeAddress("joehwtpe7ijnz4df.onion:8000"),
// new NodeAddress("uqxi3zrpobhtoes6.onion:8000"),

View file

@ -68,9 +68,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
private static final long RETRY_REPUBLISH_DELAY_SEC = 10;
private static final long REPUBLISH_AGAIN_AT_STARTUP_DELAY_SEC = 30;
@SuppressWarnings("ConstantConditions")
private static final long REPUBLISH_INTERVAL_MS = TimeUnit.MINUTES.toMillis(30);
@SuppressWarnings("ConstantConditions")
private static final long REFRESH_INTERVAL_MS = TimeUnit.MINUTES.toMillis(5);
private final KeyRing keyRing;

View file

@ -30,13 +30,10 @@ import io.bisq.core.offer.messages.OfferAvailabilityResponse;
import io.bisq.core.offer.messages.OfferMessage;
import io.bisq.core.util.Validator;
import io.bisq.network.p2p.DecryptedDirectMessageListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class OfferAvailabilityProtocol {
private static final Logger log = LoggerFactory.getLogger(OfferAvailabilityProtocol.class);
private static final long TIMEOUT = 120;
private static final long TIMEOUT = 90;
private final OfferAvailabilityModel model;
private final ResultHandler resultHandler;

View file

@ -37,7 +37,7 @@ public class ProvidersRepository {
"http://ceaanhbvluug4we6.onion/, " +// @miker
"http://44mgyoe2b6oqiytt.onion/, " +// @manfredkarrer
"http://5bmpx76qllutpcyp.onion/, " +// @manfredkarrer
"http://rb2l2qale2pqzjyo.onion/"; // @sqrrm
"http://rb2l2qale2pqzjyo.onion/"; // @manfredkarrer
private final String providersFromProgramArgs;
private final boolean useLocalhostForP2P;

View file

@ -31,7 +31,6 @@ import io.bisq.gui.main.offer.offerbook.OfferBook;
import io.bisq.gui.util.BSFormatter;
import io.bisq.gui.util.BsqFormatter;
import io.bisq.gui.util.Transitions;
import io.bisq.gui.util.validation.*;
import javafx.stage.Stage;
import org.springframework.core.env.Environment;
@ -61,13 +60,6 @@ public class GuiModule extends AppModule {
bind(BSFormatter.class).in(Singleton.class);
bind(BsqFormatter.class).in(Singleton.class);
bind(IBANValidator.class).in(Singleton.class);
bind(BtcValidator.class).in(Singleton.class);
bind(FiatVolumeValidator.class).in(Singleton.class);
bind(FiatPriceValidator.class).in(Singleton.class);
bind(AltcoinValidator.class).in(Singleton.class);
bind(InputValidator.class).in(Singleton.class);
bind(PasswordValidator.class).in(Singleton.class);
bind(Transitions.class).in(Singleton.class);
bind(Stage.class).toInstance(primaryStage);

File diff suppressed because it is too large Load diff

View file

@ -53,6 +53,7 @@ public class AddressTextField extends AnchorPane {
public AddressTextField() {
TextField textField = new TextField();
textField.setId("address-text-field");
textField.getStyleClass().addAll("highlight","show-hand");
textField.setEditable(false);
textField.textProperty().bind(address);
String tooltipText = Res.get("addressTextField.openWallet");
@ -72,14 +73,14 @@ public class AddressTextField extends AnchorPane {
Label extWalletIcon = new Label();
extWalletIcon.setLayoutY(3);
extWalletIcon.getStyleClass().add("copy-icon");
extWalletIcon.getStyleClass().addAll("icon", "highlight");
extWalletIcon.setTooltip(new Tooltip(tooltipText));
AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN);
extWalletIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet));
Label copyIcon = new Label();
copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon");
copyIcon.getStyleClass().addAll("icon", "highlight");
Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> {

View file

@ -22,6 +22,7 @@ public class AddressWithIconAndDirection extends AnchorPane {
public AddressWithIconAndDirection(String text, String address, AwesomeIcon awesomeIcon, boolean received) {
Label directionIcon = new AutoTooltipLabel();
directionIcon.setLayoutY(3);
directionIcon.getStyleClass().add("icon");
directionIcon.getStyleClass().add(received ? "received-funds-icon" : "sent-funds-icon");
AwesomeDude.setIcon(directionIcon, received ? AwesomeIcon.SIGNIN : AwesomeIcon.SIGNOUT);
directionIcon.setMouseTransparent(true);
@ -45,7 +46,7 @@ public class AddressWithIconAndDirection extends AnchorPane {
openLinkIcon = new AutoTooltipLabel();
openLinkIcon.setLayoutY(3);
openLinkIcon.getStyleClass().add("external-link-icon");
openLinkIcon.getStyleClass().addAll("icon", "highlight");
openLinkIcon.setOpacity(0.7);
AwesomeDude.setIcon(openLinkIcon, awesomeIcon);

View file

@ -47,6 +47,7 @@ public class BsqAddressTextField extends AnchorPane {
public BsqAddressTextField() {
TextField textField = new TextField();
textField.setId("address-text-field");
textField.getStyleClass().addAll("highlight","show-hand");
textField.setEditable(false);
textField.textProperty().bind(address);
String tooltipText = Res.get("addressTextField.copyToClipboard");
@ -74,7 +75,7 @@ public class BsqAddressTextField extends AnchorPane {
Label copyIcon = new AutoTooltipLabel();
copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon");
copyIcon.getStyleClass().addAll("icon", "highlight");
copyIcon.setTooltip(new Tooltip(Res.get("addressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> {

View file

@ -29,7 +29,7 @@ public class HyperlinkWithIcon extends HBox {
hyperlink = new Hyperlink(text);
icon = new AutoTooltipLabel();
icon.getStyleClass().add("external-link-icon");
icon.getStyleClass().addAll("icon", "highlight");
AwesomeDude.setIcon(icon, awesomeIcon);
icon.setMinWidth(20);
icon.setOpacity(0.7);

View file

@ -114,7 +114,7 @@ public class InfoDisplay extends Parent {
label.prefWidthProperty().bind(textFlow.widthProperty());
link.setVisited(false);
// focus border is a bit confusing here so we remove it
link.setStyle("-fx-focus-color: transparent;");
link.getStyleClass().add("hide-focus");
link.setOnAction(onAction.get());
getParent().layout();
} else {

View file

@ -67,6 +67,7 @@ public class TableGroupHeadline extends Pane {
private void setActive() {
setId("titled-group-bg-active");
label.setId("titled-group-bg-label-active");
label.getStyleClass().add("highlight");
}
public String getText() {

View file

@ -42,7 +42,7 @@ public class TextFieldWithCopyIcon extends AnchorPane {
public TextFieldWithCopyIcon() {
Label copyIcon = new AutoTooltipLabel();
copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon");
copyIcon.getStyleClass().addAll("icon", "highlight");
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 0.0);

View file

@ -75,7 +75,7 @@ public class TxIdTextField extends AnchorPane {
copyIcon = new Label();
copyIcon.setLayoutY(3);
copyIcon.getStyleClass().add("copy-icon");
copyIcon.getStyleClass().addAll("icon", "highlight");
copyIcon.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
AnchorPane.setRightAnchor(copyIcon, 30.0);
@ -83,7 +83,7 @@ public class TxIdTextField extends AnchorPane {
Tooltip tooltip = new Tooltip(Res.get("txIdTextField.blockExplorerIcon.tooltip"));
blockExplorerIcon = new Label();
blockExplorerIcon.getStyleClass().add("external-link-icon");
blockExplorerIcon.getStyleClass().addAll("icon", "highlight");
blockExplorerIcon.setTooltip(tooltip);
AwesomeDude.setIcon(blockExplorerIcon, AwesomeIcon.EXTERNAL_LINK);
blockExplorerIcon.setMinWidth(20);
@ -92,6 +92,7 @@ public class TxIdTextField extends AnchorPane {
textField = new TextField();
textField.setId("address-text-field");
textField.getStyleClass().addAll("highlight","show-hand");
textField.setEditable(false);
textField.setTooltip(tooltip);
AnchorPane.setRightAnchor(textField, 80.0);

View file

@ -285,7 +285,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
textField.setPrefWidth(115); //140
textField.setMouseTransparent(true);
textField.setFocusTraversable(false);
textField.setStyle("-fx-alignment: center; -fx-background-color: white;");
textField.getStyleClass().add("display-text-field");
Label label = new AutoTooltipLabel(text);
label.setId("nav-balance-label");
@ -330,7 +330,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
final Button btcAverageIconButton = new Button("", btcAverageIcon);
btcAverageIconButton.setPadding(new Insets(-1, 0, -1, 0));
btcAverageIconButton.setFocusTraversable(false);
btcAverageIconButton.setStyle("-fx-background-color: transparent;");
btcAverageIconButton.getStyleClass().add("hidden-icon-button");
HBox.setMargin(btcAverageIconButton, new Insets(0, 5, 0, 0));
btcAverageIconButton.setOnAction(e -> GUIUtil.openWebPage("https://bitcoinaverage.com"));
btcAverageIconButton.setVisible(model.isFiatCurrencyPriceFeedSelected.get());
@ -354,7 +354,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
final Button poloniexIconButton = new Button("", poloniexIcon);
poloniexIconButton.setPadding(new Insets(-3, 0, -3, 0));
poloniexIconButton.setFocusTraversable(false);
poloniexIconButton.setStyle("-fx-background-color: transparent;");
poloniexIconButton.getStyleClass().add("hidden-icon-button");
HBox.setMargin(poloniexIconButton, new Insets(2, 3, 0, 0));
poloniexIconButton.setOnAction(e -> GUIUtil.openWebPage("https://poloniex.com"));
poloniexIconButton.setVisible(model.isCryptoCurrencyPriceFeedSelected.get());
@ -399,7 +399,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
} else {
label.setText(Res.get("mainView.marketPrice.bisqInternalPrice"));
final Tooltip tooltip = new Tooltip(Res.get("mainView.marketPrice.tooltip.bisqInternalPrice"));
tooltip.setStyle("-fx-font-size: 12");
tooltip.getStyleClass().add("market-price-tooltip");
label.setTooltip(tooltip);
}
} else {
@ -425,7 +425,10 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
// createBitcoinInfoBox
btcSplashInfo = new AutoTooltipLabel();
btcSplashInfo.textProperty().bind(model.btcInfo);
walletServiceErrorMsgListener = (ov, oldValue, newValue) -> btcSplashInfo.setId("splash-error-state-msg");
walletServiceErrorMsgListener = (ov, oldValue, newValue) -> {
btcSplashInfo.setId("splash-error-state-msg");
btcSplashInfo.getStyleClass().add("error-text");
};
model.walletServiceErrorMsg.addListener(walletServiceErrorMsgListener);
btcSyncIndicator = new ProgressBar();
@ -467,6 +470,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
splashP2PNetworkErrorMsgListener = (ov, oldValue, newValue) -> {
if (newValue != null) {
splashP2PNetworkLabel.setId("splash-error-state-msg");
splashP2PNetworkLabel.getStyleClass().add("error-text");
splashP2PNetworkBusyAnimation.stop();
} else if (model.splashP2PNetworkAnimationVisible.get()) {
splashP2PNetworkBusyAnimation.play();
@ -555,6 +559,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
model.walletServiceErrorMsg.addListener((ov, oldValue, newValue) -> {
if (newValue != null) {
btcInfoLabel.setId("splash-error-state-msg");
btcInfoLabel.getStyleClass().add("error-text");
if (btcNetworkWarnMsgPopup == null) {
btcNetworkWarnMsgPopup = new Popup<>().warning(newValue);
btcNetworkWarnMsgPopup.show();
@ -591,12 +596,13 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
});
setBottomAnchor(versionLabel, 7d);
model.newVersionAvailableProperty.addListener((observable, oldValue, newValue) -> {
versionLabel.getStyleClass().removeAll("version-new","version");
if (newValue) {
versionLabel.setStyle("-fx-text-fill: -bs-error-red; -fx-underline: true; -fx-cursor: hand;");
versionLabel.getStyleClass().add("version-new");
versionLabel.setOnMouseClicked(e -> model.openDownloadWindow());
versionLabel.setText("v" + Version.VERSION + " " + Res.get("mainView.version.update"));
} else {
versionLabel.setStyle("-fx-text-fill: black; -fx-underline: false; -fx-cursor: null;");
versionLabel.getStyleClass().add("version");
versionLabel.setOnMouseClicked(null);
versionLabel.setText("v" + Version.VERSION);
}

View file

@ -104,9 +104,9 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
seedWordsValidChangeListener = (observable, oldValue, newValue) -> {
if (newValue) {
seedWordsTextArea.getStyleClass().remove("validation_error");
seedWordsTextArea.getStyleClass().remove("validation-error");
} else {
seedWordsTextArea.getStyleClass().add("validation_error");
seedWordsTextArea.getStyleClass().add("validation-error");
}
};
@ -137,8 +137,8 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
.show();
});
seedWordsTextArea.getStyleClass().remove("validation_error");
restoreDatePicker.getStyleClass().remove("validation_error");
seedWordsTextArea.getStyleClass().remove("validation-error");
restoreDatePicker.getStyleClass().remove("validation-error");
DeterministicSeed keyChainSeed = btcWalletService.getKeyChainSeed();
@ -178,8 +178,8 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
restoreDatePicker.setValue(null);
datePicker.setValue(null);
seedWordsTextArea.getStyleClass().remove("validation_error");
restoreDatePicker.getStyleClass().remove("validation_error");
seedWordsTextArea.getStyleClass().remove("validation-error");
restoreDatePicker.getStyleClass().remove("validation-error");
}
private void askForPassword() {

View file

@ -96,7 +96,7 @@ public class ActiveCompensationRequestView extends ActivatableView<SplitPane, Vo
@Override
public void initialize() {
root.setDividerPositions(0.3, 0.7);
root.setStyle("-fx-background-insets: 0, 0 0 0 0");
root.getStyleClass().add("compensation-root");
AnchorPane topAnchorPane = new AnchorPane();
root.getItems().add(topAnchorPane);

View file

@ -482,7 +482,7 @@ public class BsqTxView extends ActivatableView<GridPane, Void> {
break;
}
Label label = AwesomeDude.createIconLabel(awesomeIcon);
label.getStyleClass().add(style);
label.getStyleClass().addAll("icon", style);
label.setTooltip(new Tooltip(toolTipText));
setGraphic(label);
} else {

View file

@ -707,7 +707,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
messageLabel.setWrapText(true);
headerLabel.setTextAlignment(TextAlignment.CENTER);
attachmentsBox.setSpacing(5);
statusIcon.setStyle("-fx-font-size: 10;");
statusIcon.getStyleClass().add("small-text");
copyIcon.setTooltip(new Tooltip(Res.get("shared.copyToClipboard")));
messageAnchorPane.getChildren().addAll(bg, arrow, headerLabel, messageLabel, copyIcon, attachmentsBox, statusIcon);
}
@ -740,15 +740,15 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
arrow.setManaged(!item.isSystemMessage());
statusIcon.setVisible(false);
if (item.isSystemMessage()) {
headerLabel.setStyle("-fx-text-fill: -bs-green; -fx-font-size: 11;");
headerLabel.getStyleClass().addAll("message-header","success-text");
bg.setId("message-bubble-green");
messageLabel.setStyle("-fx-text-fill: white;");
copyIcon.setStyle("-fx-text-fill: white;");
messageLabel.getStyleClass().add("my-message");
copyIcon.getStyleClass().add("my-message");
} else if (isMyMsg) {
headerLabel.setStyle("-fx-text-fill: -fx-accent; -fx-font-size: 11;");
headerLabel.getStyleClass().add("highlight");
bg.setId("message-bubble-blue");
messageLabel.setStyle("-fx-text-fill: white;");
copyIcon.setStyle("-fx-text-fill: white;");
messageLabel.getStyleClass().add("my-message");
copyIcon.getStyleClass().add("my-message");
if (isTrader)
arrow.setId("bubble_arrow_blue_left");
else
@ -775,10 +775,10 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
/*else if (sendMsgProgressIndicator.getProgress() == 0)
showNotArrivedIcon();*/
} else {
headerLabel.setStyle("-fx-text-fill: -bs-light-grey; -fx-font-size: 11;");
headerLabel.getStyleClass().add("message-header");
bg.setId("message-bubble-grey");
messageLabel.setStyle("-fx-text-fill: black;");
copyIcon.setStyle("-fx-text-fill: black;");
messageLabel.getStyleClass().add("message");
copyIcon.getStyleClass().add("message");
if (isTrader)
arrow.setId("bubble_arrow_grey_right");
else
@ -828,9 +828,9 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
attachmentsBox.getChildren().add(new Label(Res.get("support.attachments") + " ") {{
setPadding(new Insets(0, 0, 3, 0));
if (isMyMsg)
setStyle("-fx-text-fill: white;");
getStyleClass().add("my-message");
else
setStyle("-fx-text-fill: black;");
getStyleClass().add("message");
}});
item.getAttachments().stream().forEach(attachment -> {
final Label icon = new Label();
@ -852,7 +852,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
// Need to set it here otherwise style is not correct
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY, "16.0");
copyIcon.getStyleClass().add("copy-icon-disputes");
copyIcon.getStyleClass().addAll("icon", "copy-icon-disputes");
// TODO There are still some cell rendering issues on updates
setGraphic(messageAnchorPane);

View file

@ -142,7 +142,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
titledGroupBg = addTitledGroupBg(gridPane, gridRow, 3, Res.get("funds.deposit.fundWallet"));
qrCodeImageView = new ImageView();
qrCodeImageView.setStyle("-fx-cursor: hand;");
qrCodeImageView.getStyleClass().add("qr-code");
Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
qrCodeImageView.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(
() -> UserThread.runAfter(

View file

@ -454,7 +454,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
tableView.setPlaceholder(placeholder);
Label titleLabel = new AutoTooltipLabel();
titleLabel.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-alignment: center");
titleLabel.getStyleClass().add("table-title ");
UserThread.execute(() -> titleLabel.prefWidthProperty().bind(tableView.widthProperty()));
boolean isSellOffer = direction == OfferPayload.Direction.SELL;

View file

@ -930,7 +930,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
qrCodeImageView = new ImageView();
qrCodeImageView.setVisible(false);
qrCodeImageView.setStyle("-fx-cursor: hand;");
qrCodeImageView.getStyleClass().add("qr-code");
Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
qrCodeImageView.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(
() -> UserThread.runAfter(
@ -1118,10 +1118,13 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
fixedPriceButton.setMouseTransparent(fixedPriceSelected);
useMarketBasedPriceButton.setMouseTransparent(!fixedPriceSelected);
fixedPriceButton.setStyle(fixedPriceSelected ?
"-fx-background-color: -bs-blue-transparent" : "-fx-background-color: -bs-very-light-grey");
useMarketBasedPriceButton.setStyle(!fixedPriceSelected ?
"-fx-background-color: -bs-blue-transparent" : "-fx-background-color: -bs-very-light-grey");
fixedPriceButton.getStyleClass().removeAll("toggle-button-active","toggle-button-inactive");
useMarketBasedPriceButton.getStyleClass().removeAll("toggle-button-active","toggle-button-inactive");
fixedPriceButton.getStyleClass().add(fixedPriceSelected ?
"toggle-button-active" : "toggle-button-inactive");
useMarketBasedPriceButton.getStyleClass().add(!fixedPriceSelected ?
"toggle-button-active" : "toggle-button-inactive");
if (fixedPriceSelected) {
if (firstRowHBox.getChildren().contains(percentagePriceBox))
@ -1160,7 +1163,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
marketBasedPriceTextField.setPromptText(Res.get("shared.enterPercentageValue"));
marketBasedPriceLabel.setText("%");
marketBasedPriceLabel.setStyle("-fx-alignment: center;");
marketBasedPriceLabel.getStyleClass().add("percentage-label");
Tuple3<HBox, InputTextField, Label> amountValueCurrencyBoxTuple = getEditableValueCurrencyBox(
Res.get("createOffer.amount.prompt"));
@ -1196,6 +1199,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
private void setupTotalToPayInfoIconLabel() {
totalToPayInfoIconLabel.setId("clickable-icon");
totalToPayInfoIconLabel.getStyleClass().addAll("highlight", "show-hand");
AwesomeDude.setIcon(totalToPayInfoIconLabel, AwesomeIcon.QUESTION_SIGN);
totalToPayInfoIconLabel.setOnMouseEntered(e -> createInfoPopover());
@ -1221,7 +1225,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.networkFee"), model.getTxFee());
Separator separator = new Separator();
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #666;");
separator.getStyleClass().add("offer-separator");
GridPane.setConstraints(separator, 1, i++);
infoGridPane.getChildren().add(separator);
addPayInfoEntry(infoGridPane, i, Res.getWithCol("shared.total"), model.getTotalToPayInfo());

View file

@ -804,7 +804,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
qrCodeImageView = new ImageView();
qrCodeImageView.setVisible(false);
qrCodeImageView.setStyle("-fx-cursor: hand;");
qrCodeImageView.getStyleClass().add("qr-code");
Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
qrCodeImageView.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(
() -> UserThread.runAfter(
@ -959,8 +959,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
priceAsPercentageInputBox = priceAsPercentageInputBoxTuple.second;
priceAsPercentageLabel.setText("%");
priceAsPercentageLabel.setStyle("-fx-alignment: center;");
priceAsPercentageLabel.getStyleClass().add("percentage-label");
Tuple3<HBox, TextField, Label> amountValueCurrencyBoxTuple = getNonEditableValueCurrencyBox();
HBox amountValueCurrencyBox = amountValueCurrencyBoxTuple.first;
@ -1004,6 +1003,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void setupTotalToPayInfoIconLabel() {
totalToPayInfoIconLabel.setId("clickable-icon");
totalToPayInfoIconLabel.getStyleClass().addAll("highlight", "show-hand");
AwesomeDude.setIcon(totalToPayInfoIconLabel, AwesomeIcon.QUESTION_SIGN);
totalToPayInfoIconLabel.setOnMouseEntered(e -> createInfoPopover());
@ -1029,7 +1029,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.networkFee"), model.getTxFee());
Separator separator = new Separator();
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #666;");
separator.getStyleClass().add("offer-separator");
GridPane.setConstraints(separator, 1, i++);
infoGridPane.getChildren().add(separator);
addPayInfoEntry(infoGridPane, i, Res.getWithCol("shared.total"),

View file

@ -705,7 +705,7 @@ public abstract class Overlay<T extends Overlay> {
Separator separator = new Separator();
separator.setMouseTransparent(true);
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #ccc;");
separator.getStyleClass().add("separator");
GridPane.setHalignment(separator, HPos.CENTER);
GridPane.setRowIndex(separator, ++rowIndex);
GridPane.setColumnSpan(separator, 2);

View file

@ -84,11 +84,7 @@ public class ContractWindow extends Overlay<ContractWindow> {
protected void createGridPane() {
super.createGridPane();
gridPane.setPadding(new Insets(35, 40, 30, 40));
gridPane.setStyle("-fx-background-color: -bs-content-bg-grey;" +
"-fx-background-radius: 5 5 5 5;" +
"-fx-effect: dropshadow(gaussian, #999, 10, 0, 0, 0);" +
"-fx-background-insets: 10;"
);
gridPane.getStyleClass().add("grid-pane");
}
private void addContent() {

View file

@ -69,14 +69,14 @@ public class DisplayAlertMessageWindow extends Overlay<DisplayAlertMessageWindow
FormBuilder.addMultilineLabel(gridPane, ++rowIndex, alert.getMessage(), 10);
if (alert.isUpdateInfo()) {
headLine = Res.get("displayAlertMessageWindow.update.headline");
headLineLabel.setStyle("-fx-text-fill: -fx-accent; -fx-font-weight: bold; -fx-font-size: 22;");
headLineLabel.getStyleClass().addAll("headline-label","highlight");
String url = "https://bisq.network/downloads";
HyperlinkWithIcon hyperlinkWithIcon = FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex,
Res.get("displayAlertMessageWindow.update.download"), url, url).second;
hyperlinkWithIcon.setMaxWidth(550);
} else {
headLine = Res.get("displayAlertMessageWindow.headline");
headLineLabel.setStyle("-fx-text-fill: -bs-error-red; -fx-font-weight: bold; -fx-font-size: 22;");
headLineLabel.getStyleClass().addAll("headline-label", "error-text");
}
closeButton = new Button(Res.get("shared.close"));
closeButton.setOnAction(e -> {

View file

@ -152,11 +152,7 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
protected void createGridPane() {
super.createGridPane();
gridPane.setPadding(new Insets(35, 40, 30, 40));
gridPane.setStyle("-fx-background-color: -bs-content-bg-grey;" +
"-fx-background-radius: 5 5 5 5;" +
"-fx-effect: dropshadow(gaussian, #999, 10, 0, 0, 0);" +
"-fx-background-insets: 10;"
);
gridPane.getStyleClass().add("grid-pane");
}
private void addContent() {

View file

@ -130,11 +130,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
protected void createGridPane() {
super.createGridPane();
gridPane.setPadding(new Insets(35, 40, 30, 40));
gridPane.setStyle("-fx-background-color: -bs-content-bg-grey;" +
"-fx-background-radius: 5 5 5 5;" +
"-fx-effect: dropshadow(gaussian, #999, 10, 0, 0, 0);" +
"-fx-background-insets: 10;"
);
gridPane.getStyleClass().add("grid-pane");
}
private void addContent() {

View file

@ -85,7 +85,7 @@ public class ShowWalletDataWindow extends Overlay<ShowWalletDataWindow> {
Label label = labelTextAreaTuple2.first;
label.setMinWidth(150);
textArea.setPrefHeight(500);
textArea.setStyle("-fx-font-size: 10;");
textArea.getStyleClass().add("small-text");
CheckBox isUpdateCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("showWalletDataWindow.includePrivKeys"), "").second;
isUpdateCheckBox.setSelected(false);

View file

@ -79,11 +79,11 @@ public class TacWindow extends Overlay<TacWindow> {
@Override
protected void addMessage() {
super.addMessage();
String fontSize = smallScreen ? "9" : "12";
messageLabel.setStyle("-fx-font-size: " + fontSize + ";");
String fontStyleClass = smallScreen ? "small-text" : "normal-text";
messageLabel.getStyleClass().add(fontStyleClass);
HyperlinkWithIcon hyperlinkWithIcon = addHyperlinkWithIcon(gridPane, ++rowIndex, Res.get("tacWindow.arbitrationSystem"),
"https://bisq.network/arbitration_system.pdf");
hyperlinkWithIcon.setStyle("-fx-font-size: " + fontSize + ";");
hyperlinkWithIcon.getStyleClass().add(fontStyleClass);
GridPane.setMargin(hyperlinkWithIcon, new Insets(-6, 0, -20, -4));
}

View file

@ -175,7 +175,7 @@ public class TorNetworkSettingsWindow extends Overlay<TorNetworkSettingsWindow>
}
private void addContent() {
gridPane.setStyle("-fx-background-color: #f8f8f8;");
gridPane.getStyleClass().add("grid-pane");
Label label = addLabel(gridPane, ++rowIndex, Res.get("torNetworkSettingWindow.info"));
label.setWrapText(true);

View file

@ -98,11 +98,7 @@ public class TradeDetailsWindow extends Overlay<TradeDetailsWindow> {
protected void createGridPane() {
super.createGridPane();
gridPane.setPadding(new Insets(35, 40, 30, 40));
gridPane.setStyle("-fx-background-color: -bs-content-bg-grey;" +
"-fx-background-radius: 5 5 5 5;" +
"-fx-effect: dropshadow(gaussian, #999, 10, 0, 0, 0);" +
"-fx-background-insets: 10;"
);
gridPane.getStyleClass().add("grid-pane");
}
private void addContent() {

View file

@ -138,8 +138,8 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
restoreButton.setOnAction(null);
seedWordsTextArea.setText("");
datePicker.setValue(null);
seedWordsTextArea.getStyleClass().remove("validation_error");
datePicker.getStyleClass().remove("validation_error");
seedWordsTextArea.getStyleClass().remove("validation-error");
datePicker.getStyleClass().remove("validation-error");
}
}
@ -257,7 +257,7 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
Separator separator = new Separator();
separator.setMouseTransparent(true);
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #ccc;");
separator.getStyleClass().add("separator");
GridPane.setHalignment(separator, HPos.CENTER);
GridPane.setRowIndex(separator, ++rowIndex);
GridPane.setColumnSpan(separator, 2);
@ -267,7 +267,7 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
Tuple2<Label, TextArea> tuple = addLabelTextArea(gridPane, ++rowIndex, Res.get("seed.seedWords"), "", 5);
seedWordsTextArea = tuple.second;
seedWordsTextArea.setPrefHeight(60);
seedWordsTextArea.setStyle("-fx-border-color: #ddd;");
seedWordsTextArea.getStyleClass().add("text-area");
Tuple2<Label, DatePicker> labelDatePickerTuple2 = addLabelDatePicker(gridPane, ++rowIndex,
Res.get("seed.creationDate"));
@ -286,9 +286,9 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
seedWordsValidChangeListener = (observable, oldValue, newValue) -> {
if (newValue) {
seedWordsTextArea.getStyleClass().remove("validation_error");
seedWordsTextArea.getStyleClass().remove("validation-error");
} else {
seedWordsTextArea.getStyleClass().add("validation_error");
seedWordsTextArea.getStyleClass().add("validation-error");
}
};
@ -310,8 +310,8 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
restoreButton.setOnAction(e -> onRestore());
seedWordsTextArea.getStyleClass().remove("validation_error");
datePicker.getStyleClass().remove("validation_error");
seedWordsTextArea.getStyleClass().remove("validation-error");
datePicker.getStyleClass().remove("validation-error");
layout();
}

View file

@ -88,7 +88,7 @@ public class DisplayUpdateDownloadWindow extends Overlay<DisplayUpdateDownloadWi
private void addContent() {
headLine = "Important update information!";
headLineLabel.setStyle("-fx-text-fill: -fx-accent; -fx-font-weight: bold; -fx-font-size: 22;");
headLineLabel.getStyleClass().addAll("headline-label", "highlight");
checkNotNull(alert, "alertMessage must not be null");
addMultilineLabel(gridPane, ++rowIndex, alert.getMessage(), 10);
@ -96,7 +96,7 @@ public class DisplayUpdateDownloadWindow extends Overlay<DisplayUpdateDownloadWi
Separator separator = new Separator();
separator.setMouseTransparent(true);
separator.setOrientation(Orientation.HORIZONTAL);
separator.setStyle("-fx-background: #ccc;");
separator.getStyleClass().add("separator");
GridPane.setHalignment(separator, HPos.CENTER);
GridPane.setRowIndex(separator, ++rowIndex);
GridPane.setColumnSpan(separator, 2);
@ -160,7 +160,7 @@ public class DisplayUpdateDownloadWindow extends Overlay<DisplayUpdateDownloadWi
Separator separator2 = new Separator();
separator2.setMouseTransparent(true);
separator2.setOrientation(Orientation.HORIZONTAL);
separator2.setStyle("-fx-background: #ccc;");
separator2.getStyleClass().add("separator");
GridPane.setHalignment(separator2, HPos.CENTER);
GridPane.setRowIndex(separator2, ++rowIndex);
GridPane.setColumnSpan(separator2, 2);
@ -206,12 +206,13 @@ public class DisplayUpdateDownloadWindow extends Overlay<DisplayUpdateDownloadWi
List<BisqInstaller.FileDescriptor> downloadResults = downloadTask.getValue();
Optional<BisqInstaller.FileDescriptor> downloadFailed = downloadResults.stream()
.filter(fileDescriptor -> !BisqInstaller.DownloadStatusEnum.OK.equals(fileDescriptor.getDownloadStatus())).findFirst();
downloadedFilesLabel.getStyleClass().removeAll("error-text","success-text");
if (downloadResults == null || downloadResults.isEmpty() || downloadFailed.isPresent()) {
showErrorMessage(downloadButton, statusLabel, downloadFailedString);
downloadedFilesLabel.setStyle("-fx-text-fill: -bs-error-red;");
downloadedFilesLabel.getStyleClass().add("error-text");
} else {
log.debug("Download completed successfully.");
downloadedFilesLabel.setStyle("-fx-text-fill: -bs-green;");
downloadedFilesLabel.getStyleClass().add("success-text");
verifyTask = installer.verify(downloadResults);
verifiedSigLabel.setOpacity(1);
@ -234,7 +235,7 @@ public class DisplayUpdateDownloadWindow extends Overlay<DisplayUpdateDownloadWi
if (verifyResults == null || verifyResults.isEmpty() || verifyFailed.isPresent()) {
showErrorMessage(downloadButton, statusLabel, Res.get("displayUpdateDownloadWindow.verify.failed"));
} else {
verifiedSigLabel.setStyle("-fx-text-fill: -bs-green;");
verifiedSigLabel.getStyleClass().add("success-text");
new Popup<>().feedback(Res.get("displayUpdateDownloadWindow.success"))
.actionButtonText(Res.get("displayUpdateDownloadWindow.download.openDir"))
.onAction(() -> {

View file

@ -307,13 +307,6 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
public void updateItem(final PendingTradesListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
/* if (model.showDispute(item.getTrade())) {
setStyle("-fx-text-fill: -bs-error-red");
} else if (model.showWarning(item.getTrade())) {
setStyle("-fx-text-fill: -bs-warning");
} else {
setId("-fx-text-fill: black");
}*/
setText(formatter.formatDateTime(item.getTrade().getDate()));
} else {
setText(null);

View file

@ -214,13 +214,13 @@ public abstract class TradeStepView extends AnchorPane {
if (remainingTime != null) {
timeLeftTextField.setText(remainingTime);
if (model.showWarning() || model.showDispute()) {
timeLeftTextField.setStyle("-fx-text-fill: -bs-error-red");
timeLeftProgressBar.setStyle("-fx-accent: -bs-error-red;");
timeLeftTextField.getStyleClass().add("error-text");
timeLeftProgressBar.getStyleClass().add("error");
}
} else {
timeLeftTextField.setText("Trade not completed in time (" + model.getDateForOpenDispute() + ")");
timeLeftTextField.setStyle("-fx-text-fill: -bs-error-red");
timeLeftProgressBar.setStyle("-fx-accent: -bs-error-red;");
timeLeftTextField.getStyleClass().add("error-text");
timeLeftProgressBar.getStyleClass().add("error");
}
}
}

View file

@ -86,13 +86,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>3.1.0</version>
<configuration>
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
<minimizeJar>false</minimizeJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>io.bisq.monitor.MonitorMain</Main-Class>
<!-- the specified bouncy castle jar classes -->

View file

@ -30,11 +30,10 @@ import java.util.UUID;
import static com.google.common.base.Preconditions.checkNotNull;
// TODO close connection if failing
public class HttpClient {
private static final Logger log = LoggerFactory.getLogger(HttpClient.class);
@Nullable
private Socks5ProxyProvider socks5ProxyProvider;
@Getter

View file

@ -43,6 +43,7 @@ import org.slf4j.LoggerFactory;
import java.security.PublicKey;
import java.util.*;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@ -234,7 +235,6 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
///////////////////////////////////////////////////////////////////////////////////////////
// SetupListener implementation
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onTorNodeReady() {
Log.traceCall();
@ -284,8 +284,18 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
"seedNodeOfPreliminaryDataRequest must be present");
requestDataManager.requestUpdateData();
// If we start up first time we don't have any peers so we need to request from seed node.
// As well it can be that the persisted peer list is outdated with dead peers.
UserThread.runAfter(() -> {
peerExchangeManager.requestReportedPeersFromSeedNodes(seedNodeOfPreliminaryDataRequest.get());
}, 100, TimeUnit.MILLISECONDS);
// If we have reported or persisted peers we try to connect to those
UserThread.runAfter(peerExchangeManager::initialRequestPeersFromReportedOrPersistedPeers, 300, TimeUnit.MILLISECONDS);
}
///////////////////////////////////////////////////////////////////////////////////////////
// RequestDataManager.Listener implementation
///////////////////////////////////////////////////////////////////////////////////////////
@ -299,11 +309,6 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
@Override
public void onUpdatedDataReceived() {
Optional<NodeAddress> seedNodeOfPreliminaryDataRequest = requestDataManager.getNodeAddressOfPreliminaryDataRequest();
checkArgument(seedNodeOfPreliminaryDataRequest.isPresent(),
"seedNodeOfPreliminaryDataRequest must be present");
peerExchangeManager.requestReportedPeersFromSeedNodes(seedNodeOfPreliminaryDataRequest.get());
if (!isBootstrapped) {
isBootstrapped = true;
p2pServiceListeners.stream().forEach(P2PServiceListener::onBootstrapComplete);
@ -445,6 +450,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
@Override
public void onFailure(@NotNull Throwable throwable) {
log.error(throwable.toString());
throwable.printStackTrace();
sendDirectMessageListener.onFault();
}
@ -531,10 +537,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
@Override
public void onFailure(@NotNull Throwable throwable) {
log.trace("SendEncryptedMailboxMessage onFailure");
log.debug(throwable.toString());
log.debug("We cannot send message to peer. Peer might be offline. We will store message in mailbox.");
log.trace("create MailboxEntry with peerAddress " + peersNodeAddress);
log.info("We cannot send message to peer. Peer might be offline. We will store message in mailbox. peersNodeAddress=" + peersNodeAddress);
PublicKey receiverStoragePublicKey = peersPubKeyRing.getSignaturePubKey();
addMailboxData(new MailboxStoragePayload(prefixedSealedAndSignedMessage,
keyRing.getSignatureKeyPair().getPublic(),

View file

@ -6,16 +6,12 @@ import javafx.beans.property.IntegerProperty;
import javafx.beans.property.LongProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleLongProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class Statistic {
private static final Logger log = LoggerFactory.getLogger(Statistic.class);
///////////////////////////////////////////////////////////////////////////////////////////
// Static

View file

@ -254,7 +254,7 @@ public class TorNetworkNode extends NetworkNode {
public void onFailure(@NotNull Throwable throwable) {
UserThread.execute(() -> {
log.error("Hidden service creation failed", throwable);
log.error("Hidden service creation failed" + throwable);
restartTor(throwable.getMessage());
});
}

View file

@ -11,22 +11,22 @@ import io.bisq.network.p2p.NodeAddress;
import io.bisq.network.p2p.network.Connection;
import io.bisq.network.p2p.network.NetworkNode;
import io.bisq.network.p2p.storage.messages.BroadcastMessage;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Slf4j
public class BroadcastHandler implements PeerManager.Listener {
///////////////////////////////////////////////////////////////////////////////////////////
// Static
///////////////////////////////////////////////////////////////////////////////////////////
private static final long TIMEOUT = 60;
private static final Logger log = LoggerFactory.getLogger(BroadcastHandler.class);
private static final long TIMEOUT = 120;
///////////////////////////////////////////////////////////////////////////////////////////
// Listener
///////////////////////////////////////////////////////////////////////////////////////////
interface ResultHandler {
void onCompleted(BroadcastHandler broadcastHandler);
@ -34,11 +34,6 @@ public class BroadcastHandler implements PeerManager.Listener {
void onFault(BroadcastHandler broadcastHandler);
}
///////////////////////////////////////////////////////////////////////////////////////////
// Listener
///////////////////////////////////////////////////////////////////////////////////////////
public interface Listener {
@SuppressWarnings({"EmptyMethod", "UnusedParameters"})
void onBroadcasted(BroadcastMessage message, int numOfCompletedBroadcasts);
@ -182,7 +177,7 @@ public class BroadcastHandler implements PeerManager.Listener {
public void onFailure(@NotNull Throwable throwable) {
numOfFailedBroadcasts++;
if (!stopped) {
log.debug("Broadcast to " + nodeAddress + " failed.\n\t" +
log.info("Broadcast to " + nodeAddress + " failed.\n\t" +
"ErrorMessage=" + throwable.getMessage());
if (numOfCompletedBroadcasts + numOfFailedBroadcasts == numPeers)
onFault("stopped at onFailure: " + errorMessage);

View file

@ -14,6 +14,7 @@ import io.bisq.network.p2p.network.*;
import io.bisq.network.p2p.peers.peerexchange.Peer;
import io.bisq.network.p2p.peers.peerexchange.PeerList;
import io.bisq.network.p2p.seed.SeedNodesRepository;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
@ -33,7 +34,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
private static final long CHECK_MAX_CONN_DELAY_SEC = 10;
// Use a long delay as the bootstrapping peer might need a while until it knows its onion address
private static final long REMOVE_ANONYMOUS_PEER_SEC = 120;
private static final long REMOVE_ANONYMOUS_PEER_SEC = 240;
private static final int MAX_REPORTED_PEERS = 1000;
private static final int MAX_PERSISTED_PEERS = 500;
@ -73,7 +74,9 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
private boolean stopped;
private boolean lostAllConnections;
@Getter
private int minConnections;
private int disconnectFromSeedNode;
private int maxConnectionsPeer;
private int maxConnectionsNonDirect;
private int maxConnectionsAbsolute;
@ -154,12 +157,14 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
}
// Modify this to change the relationships between connection limits.
// maxConnections default 12
private void setConnectionLimits(int maxConnections) {
this.maxConnections = maxConnections;
minConnections = Math.max(1, maxConnections - 4);
maxConnectionsPeer = maxConnections + 4;
maxConnectionsNonDirect = maxConnections + 8;
maxConnectionsAbsolute = maxConnections + 18;
this.maxConnections = maxConnections; // 12
disconnectFromSeedNode = Math.min(6, maxConnections + 1); // 6
minConnections = Math.max(1, maxConnections - 4); // 1-8
maxConnectionsPeer = maxConnections + 4; // 16
maxConnectionsNonDirect = maxConnections + 8; // 20
maxConnectionsAbsolute = maxConnections + 18; // 30 -> seedNode with maxConnections=30 -> 48
}
///////////////////////////////////////////////////////////////////////////////////////////
@ -244,7 +249,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
removeSuperfluousSeedNodes();
removeTooOldReportedPeers();
removeTooOldPersistedPeers();
checkMaxConnections(maxConnections);
checkMaxConnections();
} else {
log.debug("We have stopped already. We ignore that checkMaxConnectionsTimer.run call.");
}
@ -252,13 +257,13 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
}
}
private boolean checkMaxConnections(int limit) {
Log.traceCall("limit=" + limit);
private boolean checkMaxConnections() {
Log.traceCall("maxConnections=" + maxConnections);
Set<Connection> allConnections = networkNode.getAllConnections();
int size = allConnections.size();
log.debug("We have {} connections open. Our limit is {}", size, limit);
log.debug("We have {} connections open. Our limit is {}", size, maxConnections);
if (size > limit) {
if (size > maxConnections) {
log.debug("We have too many connections open.\n\t" +
"Lets try first to remove the inbound connections of type PEER.");
List<Connection> candidates = allConnections.stream()
@ -266,7 +271,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
.filter(e -> e.getPeerType() == Connection.PeerType.PEER)
.collect(Collectors.toList());
if (candidates.size() == 0) {
if (candidates.isEmpty()) {
log.debug("No candidates found. We check if we exceed our " +
"maxConnectionsPeer limit of {}", maxConnectionsPeer);
if (size > maxConnectionsPeer) {
@ -275,7 +280,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
.filter(e -> e.getPeerType() == Connection.PeerType.PEER)
.collect(Collectors.toList());
if (candidates.size() == 0) {
if (candidates.isEmpty()) {
log.debug("No candidates found. We check if we exceed our " +
"maxConnectionsNonDirect limit of {}", maxConnectionsNonDirect);
if (size > maxConnectionsNonDirect) {
@ -284,7 +289,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
.filter(e -> e.getPeerType() != Connection.PeerType.DIRECT_MSG_PEER && e.getPeerType() != Connection.PeerType.INITIAL_DATA_REQUEST)
.collect(Collectors.toList());
if (candidates.size() == 0) {
if (candidates.isEmpty()) {
log.debug("No candidates found. We check if we exceed our " +
"maxConnectionsAbsolute limit of {}", maxConnectionsAbsolute);
if (size > maxConnectionsAbsolute) {
@ -297,13 +302,13 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
}
}
if (candidates.size() > 0) {
if (!candidates.isEmpty()) {
candidates.sort((o1, o2) -> ((Long) o1.getStatistic().getLastActivityTimestamp()).compareTo(((Long) o2.getStatistic().getLastActivityTimestamp())));
log.debug("Candidates.size() for shut down=" + candidates.size());
Connection connection = candidates.remove(0);
log.debug("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
if (!connection.isStopped())
connection.shutDown(CloseConnectionReason.TOO_MANY_CONNECTIONS_OPEN, () -> checkMaxConnections(limit));
connection.shutDown(CloseConnectionReason.TOO_MANY_CONNECTIONS_OPEN, () -> UserThread.runAfter(this::checkMaxConnections, 100, TimeUnit.MILLISECONDS));
return true;
} else {
log.warn("No candidates found to remove (That case should not be possible as we use in the " +
@ -322,7 +327,9 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
networkNode.getAllConnections().stream()
.filter(connection -> !connection.hasPeersNodeAddress())
.forEach(connection -> UserThread.runAfter(() -> {
// We give 30 seconds delay and check again if still no address is set
// We give 240 seconds delay and check again if still no address is set
// Keep the delay long as we don't want to disconnect a peer in case we are a seed node just
// because he needs longer for the HS publishing
if (!connection.hasPeersNodeAddress() && !connection.isStopped()) {
log.debug("We close the connection as the peer address is still unknown.\n\t" +
"connection=" + connection);
@ -333,20 +340,18 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
private void removeSuperfluousSeedNodes() {
Log.traceCall();
if (networkNode.getConfirmedConnections().size() > maxConnections) {
Set<Connection> connections = networkNode.getConfirmedConnections();
if (hasSufficientConnections()) {
List<Connection> candidates = connections.stream()
.filter(this::isSeedNode)
.collect(Collectors.toList());
if (networkNode.getConfirmedConnections().size() > disconnectFromSeedNode) {
List<Connection> seedNodes = networkNode.getConfirmedConnections().stream()
.filter(this::isSeedNode)
.collect(Collectors.toList());
if (candidates.size() > 1) {
candidates.sort((o1, o2) -> ((Long) o1.getStatistic().getLastActivityTimestamp()).compareTo(((Long) o2.getStatistic().getLastActivityTimestamp())));
log.debug("Number of connections exceeding MAX_CONNECTIONS_EXTENDED_1. Current size=" + candidates.size());
Connection connection = candidates.remove(0);
log.debug("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
connection.shutDown(CloseConnectionReason.TOO_MANY_SEED_NODES_CONNECTED, this::removeSuperfluousSeedNodes);
}
if (!seedNodes.isEmpty()) {
seedNodes.sort((o1, o2) -> ((Long) o1.getStatistic().getLastActivityTimestamp()).compareTo(((Long) o2.getStatistic().getLastActivityTimestamp())));
log.debug("Number of seed node connections to disconnect. Current size=" + seedNodes.size());
Connection connection = seedNodes.get(0);
log.debug("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
connection.shutDown(CloseConnectionReason.TOO_MANY_SEED_NODES_CONNECTED,
() -> UserThread.runAfter(this::removeSuperfluousSeedNodes, 200, TimeUnit.MILLISECONDS));
}
}
}
@ -443,7 +448,7 @@ public class PeerManager implements ConnectionListener, PersistedDataHost {
result.append("\n------------------------------------------------------------\n");
log.debug(result.toString());
}
log.debug("Number of collected reported peers: {}", reportedPeers.size());
log.info("Number of reported peers: {}", reportedPeers.size());
}
}

View file

@ -19,9 +19,8 @@ import io.bisq.network.p2p.storage.payload.CapabilityRequiringPayload;
import io.bisq.network.p2p.storage.payload.PersistableNetworkPayload;
import io.bisq.network.p2p.storage.payload.ProtectedStorageEntry;
import io.bisq.network.p2p.storage.payload.ProtectedStoragePayload;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashSet;
import java.util.List;
@ -29,11 +28,9 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Slf4j
public class GetDataRequestHandler {
private static final Logger log = LoggerFactory.getLogger(GetDataRequestHandler.class);
private static final long TIMEOUT = 120;
private static final long TIMEOUT = 60;
///////////////////////////////////////////////////////////////////////////////////////////
@ -195,7 +192,7 @@ public class GetDataRequestHandler {
private void handleFault(String errorMessage, CloseConnectionReason closeConnectionReason, Connection connection) {
if (!stopped) {
log.debug(errorMessage + "\n\tcloseConnectionReason=" + closeConnectionReason);
log.info(errorMessage + "\n\tcloseConnectionReason=" + closeConnectionReason);
cleanup();
listener.onFault(errorMessage, connection);
} else {

View file

@ -35,7 +35,7 @@ import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
class RequestDataHandler implements MessageListener {
private static final long TIMEOUT = 120;
private static final long TIMEOUT = 60;
private NodeAddress peersNodeAddress;
@ -142,7 +142,6 @@ class RequestDataHandler implements MessageListener {
" failed. That is expected if the peer is offline.\n\t" +
"getDataRequest=" + getDataRequest + "." +
"\n\tException=" + throwable.getMessage();
log.debug(errorMessage);
handleFault(errorMessage, nodeAddress, CloseConnectionReason.SEND_MSG_FAILURE);
} else {
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call. " +
@ -299,6 +298,7 @@ class RequestDataHandler implements MessageListener {
@SuppressWarnings("UnusedParameters")
private void handleFault(String errorMessage, NodeAddress nodeAddress, CloseConnectionReason closeConnectionReason) {
cleanup();
log.info(errorMessage);
//peerManager.shutDownConnection(nodeAddress, closeConnectionReason);
peerManager.handleConnectionFault(nodeAddress);
listener.onFault(errorMessage, null);

View file

@ -11,9 +11,8 @@ import io.bisq.network.p2p.peers.getdata.messages.GetDataRequest;
import io.bisq.network.p2p.peers.peerexchange.Peer;
import io.bisq.network.p2p.seed.SeedNodesRepository;
import io.bisq.network.p2p.storage.P2PDataStorage;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import java.util.*;
@ -21,9 +20,8 @@ import java.util.stream.Collectors;
import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
public class RequestDataManager implements MessageListener, ConnectionListener, PeerManager.Listener {
private static final Logger log = LoggerFactory.getLogger(RequestDataManager.class);
private static final long RETRY_DELAY_SEC = 10;
private static final long CLEANUP_TIMER = 120;
private boolean isPreliminaryDataRequest = true;
@ -208,30 +206,30 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
final String uid = connection.getUid();
if (!getDataRequestHandlers.containsKey(uid)) {
GetDataRequestHandler getDataRequestHandler = new GetDataRequestHandler(networkNode, dataStorage,
new GetDataRequestHandler.Listener() {
@Override
public void onComplete() {
getDataRequestHandlers.remove(uid);
log.trace("requestDataHandshake completed.\n\tConnection={}", connection);
}
@Override
public void onFault(String errorMessage, @Nullable Connection connection) {
getDataRequestHandlers.remove(uid);
if (!stopped) {
log.trace("GetDataRequestHandler failed.\n\tConnection={}\n\t" +
"ErrorMessage={}", connection, errorMessage);
peerManager.handleConnectionFault(connection);
} else {
log.warn("We have stopped already. We ignore that getDataRequestHandler.handle.onFault call.");
new GetDataRequestHandler.Listener() {
@Override
public void onComplete() {
getDataRequestHandlers.remove(uid);
log.trace("requestDataHandshake completed.\n\tConnection={}", connection);
}
}
});
@Override
public void onFault(String errorMessage, @Nullable Connection connection) {
getDataRequestHandlers.remove(uid);
if (!stopped) {
log.trace("GetDataRequestHandler failed.\n\tConnection={}\n\t" +
"ErrorMessage={}", connection, errorMessage);
peerManager.handleConnectionFault(connection);
} else {
log.warn("We have stopped already. We ignore that getDataRequestHandler.handle.onFault call.");
}
}
});
getDataRequestHandlers.put(uid, getDataRequestHandler);
getDataRequestHandler.handle((GetDataRequest) networkEnvelop, connection);
} else {
log.warn("We have already a GetDataRequestHandler for that connection started. " +
"We start a cleanup timer if the handler has not closed by itself in between 2 minutes.");
"We start a cleanup timer if the handler has not closed by itself in between 2 minutes.");
UserThread.runAfter(() -> {
if (getDataRequestHandlers.containsKey(uid)) {
@ -256,68 +254,68 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
if (!stopped) {
if (!handlerMap.containsKey(nodeAddress)) {
RequestDataHandler requestDataHandler = new RequestDataHandler(networkNode, dataStorage, peerManager,
new RequestDataHandler.Listener() {
@Override
public void onComplete() {
log.trace("RequestDataHandshake of outbound connection complete. nodeAddress={}",
nodeAddress);
stopRetryTimer();
new RequestDataHandler.Listener() {
@Override
public void onComplete() {
log.trace("RequestDataHandshake of outbound connection complete. nodeAddress={}",
nodeAddress);
stopRetryTimer();
// need to remove before listeners are notified as they cause the update call
handlerMap.remove(nodeAddress);
// need to remove before listeners are notified as they cause the update call
handlerMap.remove(nodeAddress);
// 1. We get a response from requestPreliminaryData
if (!nodeAddressOfPreliminaryDataRequest.isPresent()) {
nodeAddressOfPreliminaryDataRequest = Optional.of(nodeAddress);
listener.onPreliminaryDataReceived();
}
// 2. Later we get a response from requestUpdatesData
if (dataUpdateRequested) {
dataUpdateRequested = false;
listener.onUpdatedDataReceived();
}
listener.onDataReceived();
}
@Override
public void onFault(String errorMessage, @Nullable Connection connection) {
log.trace("requestDataHandshake with outbound connection failed.\n\tnodeAddress={}\n\t" +
"ErrorMessage={}", nodeAddress, errorMessage);
peerManager.handleConnectionFault(nodeAddress);
handlerMap.remove(nodeAddress);
if (!remainingNodeAddresses.isEmpty()) {
log.debug("There are remaining nodes available for requesting data. " +
"We will try requestDataFromPeers again.");
NodeAddress nextCandidate = remainingNodeAddresses.get(0);
remainingNodeAddresses.remove(nextCandidate);
requestData(nextCandidate, remainingNodeAddresses);
} else {
log.debug("There is no remaining node available for requesting data. " +
"That is expected if no other node is online.\n\t" +
"We will try to use reported peers (if no available we use persisted peers) " +
"and try again to request data from our seed nodes after a random pause.");
// Notify listeners
// 1. We get a response from requestPreliminaryData
if (!nodeAddressOfPreliminaryDataRequest.isPresent()) {
if (peerManager.isSeedNode(nodeAddress))
listener.onNoSeedNodeAvailable();
else
listener.onNoPeersAvailable();
nodeAddressOfPreliminaryDataRequest = Optional.of(nodeAddress);
listener.onPreliminaryDataReceived();
}
restart();
// 2. Later we get a response from requestUpdatesData
if (dataUpdateRequested) {
dataUpdateRequested = false;
listener.onUpdatedDataReceived();
}
listener.onDataReceived();
}
}
});
@Override
public void onFault(String errorMessage, @Nullable Connection connection) {
log.trace("requestDataHandshake with outbound connection failed.\n\tnodeAddress={}\n\t" +
"ErrorMessage={}", nodeAddress, errorMessage);
peerManager.handleConnectionFault(nodeAddress);
handlerMap.remove(nodeAddress);
if (!remainingNodeAddresses.isEmpty()) {
log.debug("There are remaining nodes available for requesting data. " +
"We will try requestDataFromPeers again.");
NodeAddress nextCandidate = remainingNodeAddresses.get(0);
remainingNodeAddresses.remove(nextCandidate);
requestData(nextCandidate, remainingNodeAddresses);
} else {
log.debug("There is no remaining node available for requesting data. " +
"That is expected if no other node is online.\n\t" +
"We will try to use reported peers (if no available we use persisted peers) " +
"and try again to request data from our seed nodes after a random pause.");
// Notify listeners
if (!nodeAddressOfPreliminaryDataRequest.isPresent()) {
if (peerManager.isSeedNode(nodeAddress))
listener.onNoSeedNodeAvailable();
else
listener.onNoPeersAvailable();
}
restart();
}
}
});
handlerMap.put(nodeAddress, requestDataHandler);
requestDataHandler.requestData(nodeAddress, isPreliminaryDataRequest);
} else {
log.warn("We have started already a requestDataHandshake to peer. nodeAddress=" + nodeAddress + "\n" +
"We start a cleanup timer if the handler has not closed by itself in between 2 minutes.");
"We start a cleanup timer if the handler has not closed by itself in between 2 minutes.");
UserThread.runAfter(() -> {
if (handlerMap.containsKey(nodeAddress)) {
@ -341,54 +339,54 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
Log.traceCall();
if (retryTimer == null) {
retryTimer = UserThread.runAfter(() -> {
log.trace("retryTimer called");
stopped = false;
log.trace("retryTimer called");
stopped = false;
stopRetryTimer();
stopRetryTimer();
// We create a new list of candidates
// 1. shuffled seedNodes
// 2. reported peers sorted by last activity date
// 3. Add as last persisted peers sorted by last activity date
List<NodeAddress> list = getFilteredList(new ArrayList<>(seedNodeAddresses), new ArrayList<>());
Collections.shuffle(list);
// We create a new list of candidates
// 1. shuffled seedNodes
// 2. reported peers sorted by last activity date
// 3. Add as last persisted peers sorted by last activity date
List<NodeAddress> list = getFilteredList(new ArrayList<>(seedNodeAddresses), new ArrayList<>());
Collections.shuffle(list);
List<NodeAddress> filteredReportedPeers = getFilteredNonSeedNodeList(getSortedNodeAddresses(peerManager.getReportedPeers()), list);
list.addAll(filteredReportedPeers);
List<NodeAddress> filteredReportedPeers = getFilteredNonSeedNodeList(getSortedNodeAddresses(peerManager.getReportedPeers()), list);
list.addAll(filteredReportedPeers);
List<NodeAddress> filteredPersistedPeers = getFilteredNonSeedNodeList(getSortedNodeAddresses(peerManager.getPersistedPeers()), list);
list.addAll(filteredPersistedPeers);
List<NodeAddress> filteredPersistedPeers = getFilteredNonSeedNodeList(getSortedNodeAddresses(peerManager.getPersistedPeers()), list);
list.addAll(filteredPersistedPeers);
if (!list.isEmpty()) {
NodeAddress nextCandidate = list.get(0);
list.remove(nextCandidate);
requestData(nextCandidate, list);
}
},
RETRY_DELAY_SEC);
if (!list.isEmpty()) {
NodeAddress nextCandidate = list.get(0);
list.remove(nextCandidate);
requestData(nextCandidate, list);
}
},
RETRY_DELAY_SEC);
}
}
private List<NodeAddress> getSortedNodeAddresses(Collection<Peer> collection) {
return collection.stream()
.collect(Collectors.toList())
.stream()
.sorted((o1, o2) -> o2.getDate().compareTo(o1.getDate()))
.map(Peer::getNodeAddress)
.collect(Collectors.toList());
.collect(Collectors.toList())
.stream()
.sorted((o1, o2) -> o2.getDate().compareTo(o1.getDate()))
.map(Peer::getNodeAddress)
.collect(Collectors.toList());
}
private List<NodeAddress> getFilteredList(Collection<NodeAddress> collection, List<NodeAddress> list) {
return collection.stream()
.filter(e -> !list.contains(e) &&
!peerManager.isSelf(e))
.collect(Collectors.toList());
.filter(e -> !list.contains(e) &&
!peerManager.isSelf(e))
.collect(Collectors.toList());
}
private List<NodeAddress> getFilteredNonSeedNodeList(Collection<NodeAddress> collection, List<NodeAddress> list) {
return getFilteredList(collection, list).stream()
.filter(e -> !peerManager.isSeedNode(e))
.collect(Collectors.toList());
.filter(e -> !peerManager.isSeedNode(e))
.collect(Collectors.toList());
}
private void stopRetryTimer() {

View file

@ -101,9 +101,9 @@ class KeepAliveHandler implements MessageListener {
String errorMessage = "Sending ping to " + connection +
" failed. That is expected if the peer is offline.\n\tping=" + ping +
".\n\tException=" + throwable.getMessage();
log.debug(errorMessage);
cleanup();
//peerManager.shutDownConnection(connection, CloseConnectionReason.SEND_MSG_FAILURE);
log.info(errorMessage);
peerManager.handleConnectionFault(connection);
listener.onFault(errorMessage);
} else {

View file

@ -95,9 +95,9 @@ public class KeepAliveManager implements MessageListener, ConnectionListener, Pe
public void onFailure(@NotNull Throwable throwable) {
if (!stopped) {
String errorMessage = "Sending pong to " + connection +
" failed. That is expected if the peer is offline. pong=" + pong + "." +
" failed. That is expected if the peer is offline. "+
"Exception: " + throwable.getMessage();
log.debug(errorMessage);
log.info(errorMessage);
peerManager.handleConnectionFault(connection);
} else {
log.warn("We have stopped already. We ignore that networkNode.sendMessage.onFailure call.");

View file

@ -21,7 +21,8 @@ import static com.google.common.base.Preconditions.checkArgument;
@Slf4j
class GetPeersRequestHandler {
private static final long TIMEOUT = 120;
// We want to keep timeout short here
private static final long TIMEOUT = 40;
///////////////////////////////////////////////////////////////////////////////////////////
@ -103,7 +104,7 @@ class GetPeersRequestHandler {
String errorMessage = "Sending getPeersResponse to " + connection +
" failed. That is expected if the peer is offline. getPeersResponse=" + getPeersResponse + "." +
"Exception: " + throwable.getMessage();
log.debug(errorMessage);
log.info(errorMessage);
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, connection);
} else {
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call.");

View file

@ -21,10 +21,12 @@ import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable;
import java.util.Random;
import java.util.concurrent.TimeUnit;
@Slf4j
class PeerExchangeHandler implements MessageListener {
private static final long TIMEOUT = 120;
private static final int DELAY_MS = 1000;
// We want to keep timeout short here
private static final long TIMEOUT = 40;
private static final int DELAY_MS = 500;
///////////////////////////////////////////////////////////////////////////////////////////
@ -79,17 +81,14 @@ class PeerExchangeHandler implements MessageListener {
private void sendGetPeersRequest(NodeAddress nodeAddress) {
Log.traceCall("nodeAddress=" + nodeAddress + " / this=" + this);
log.info("sendGetPeersRequest to nodeAddress={}", nodeAddress);
if (!stopped) {
if (networkNode.getNodeAddress() != null) {
GetPeersRequest getPeersRequest = new GetPeersRequest(networkNode.getNodeAddress(), nonce, peerManager.getConnectedNonSeedNodeReportedPeers(nodeAddress));
if (timeoutTimer == null) {
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
if (!stopped) {
String errorMessage = "A timeout occurred at sending getPeersRequest:" + getPeersRequest + " for nodeAddress:" + nodeAddress;
log.debug(errorMessage + " / PeerExchangeHandler=" +
PeerExchangeHandler.this);
log.debug("timeoutTimer called on " + this);
String errorMessage = "A timeout occurred at sending getPeersRequest. nodeAddress=" + nodeAddress;
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, nodeAddress);
} else {
log.trace("We have stopped that handler already. We ignore that timeoutTimer.run call.");
@ -121,9 +120,7 @@ class PeerExchangeHandler implements MessageListener {
public void onFailure(@NotNull Throwable throwable) {
if (!stopped) {
String errorMessage = "Sending getPeersRequest to " + nodeAddress +
" failed. That is expected if the peer is offline.\n\tgetPeersRequest=" + getPeersRequest +
".\n\tException=" + throwable.getMessage();
log.debug(errorMessage);
" failed. That is expected if the peer is offline. Exception=" + throwable.getMessage();
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, nodeAddress);
} else {
log.trace("We have stopped that handler already. We ignore that sendGetPeersRequest.onFailure call.");

View file

@ -10,8 +10,7 @@ import io.bisq.network.p2p.network.*;
import io.bisq.network.p2p.peers.PeerManager;
import io.bisq.network.p2p.peers.peerexchange.messages.GetPeersRequest;
import io.bisq.network.p2p.seed.SeedNodesRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import javax.inject.Inject;
@ -19,12 +18,11 @@ import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Slf4j
public class PeerExchangeManager implements MessageListener, ConnectionListener, PeerManager.Listener {
private static final Logger log = LoggerFactory.getLogger(PeerExchangeManager.class);
private static final long RETRY_DELAY_SEC = 10;
private static final long RETRY_DELAY_AFTER_ALL_CON_LOST_SEC = 3;
private static final long REQUEST_PERIODICALLY_INTERVAL_SEC = 10 * 60;
private static final long REQUEST_PERIODICALLY_INTERVAL_MIN = 10;
private final NetworkNode networkNode;
private final PeerManager peerManager;
@ -81,6 +79,19 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
startPeriodicTimer();
}
public void initialRequestPeersFromReportedOrPersistedPeers() {
if (!peerManager.getReportedPeers().isEmpty() || !peerManager.getPersistedPeers().isEmpty()) {
// We will likely get more connections as the GetPeersResponse onComplete handler triggers a new request if the confirmed
// connections have not reached the min connection target.
// So we potentially request 2 times 8 but we prefer to get fast connected
// and disconnect afterwards when we exceed max connections rather to delay connection in case many of our peers from the list are dead.
for (int i = 0; i < Math.min(8, peerManager.getMaxConnections()); i++)
requestWithAvailablePeers();
} else {
log.info("We don't have any reported or persisted peers, so we need to wait until we receive from the seed node the initial peer list.");
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// ConnectionListener implementation
@ -158,20 +169,20 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
connection.setPeerType(Connection.PeerType.SEED_NODE);
GetPeersRequestHandler getPeersRequestHandler = new GetPeersRequestHandler(networkNode,
peerManager,
new GetPeersRequestHandler.Listener() {
@Override
public void onComplete() {
log.trace("PeerExchangeHandshake completed.\n\tConnection={}", connection);
}
peerManager,
new GetPeersRequestHandler.Listener() {
@Override
public void onComplete() {
log.trace("PeerExchangeHandshake completed.\n\tConnection={}", connection);
}
@Override
public void onFault(String errorMessage, Connection connection) {
log.trace("PeerExchangeHandshake failed.\n\terrorMessage={}\n\t" +
"connection={}", errorMessage, connection);
peerManager.handleConnectionFault(connection);
}
});
@Override
public void onFault(String errorMessage, Connection connection) {
log.trace("PeerExchangeHandshake failed.\n\terrorMessage={}\n\t" +
"connection={}", errorMessage, connection);
peerManager.handleConnectionFault(connection);
}
});
getPeersRequestHandler.handle((GetPeersRequest) networkEnvelop, connection);
} else {
log.warn("We have stopped already. We ignore that onMessage call.");
@ -189,56 +200,55 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
if (!stopped) {
if (!handlerMap.containsKey(nodeAddress)) {
PeerExchangeHandler peerExchangeHandler = new PeerExchangeHandler(networkNode,
peerManager,
new PeerExchangeHandler.Listener() {
@Override
public void onComplete() {
log.trace("PeerExchangeHandshake of outbound connection complete. nodeAddress={}", nodeAddress);
handlerMap.remove(nodeAddress);
requestWithAvailablePeers();
}
@Override
public void onFault(String errorMessage, @Nullable Connection connection) {
log.trace("PeerExchangeHandshake of outbound connection failed.\n\terrorMessage={}\n\t" +
"nodeAddress={}", errorMessage, nodeAddress);
peerManager.handleConnectionFault(nodeAddress);
handlerMap.remove(nodeAddress);
if (!remainingNodeAddresses.isEmpty()) {
if (!peerManager.hasSufficientConnections()) {
log.debug("There are remaining nodes available for requesting peers. " +
"We will try getReportedPeers again.");
NodeAddress nextCandidate = remainingNodeAddresses.get(new Random().nextInt(remainingNodeAddresses.size()));
remainingNodeAddresses.remove(nextCandidate);
requestReportedPeers(nextCandidate, remainingNodeAddresses);
} else {
// That path will rarely be reached
log.debug("We have already sufficient connections.");
}
} else {
log.debug("There is no remaining node available for requesting peers. " +
"That is expected if no other node is online.\n\t" +
"We will try again after a pause.");
if (retryTimer == null)
retryTimer = UserThread.runAfter(() -> {
if (!stopped) {
log.trace("retryTimer called from requestReportedPeers code path");
stopRetryTimer();
requestWithAvailablePeers();
} else {
stopRetryTimer();
log.warn("We have stopped already. We ignore that retryTimer.run call.");
}
}, RETRY_DELAY_SEC);
peerManager,
new PeerExchangeHandler.Listener() {
@Override
public void onComplete() {
handlerMap.remove(nodeAddress);
requestWithAvailablePeers();
}
}
});
@Override
public void onFault(String errorMessage, @Nullable Connection connection) {
log.info("PeerExchangeHandshake of outbound connection failed.\n\terrorMessage={}\n\t" +
"nodeAddress={}", errorMessage, nodeAddress);
peerManager.handleConnectionFault(nodeAddress);
handlerMap.remove(nodeAddress);
if (!remainingNodeAddresses.isEmpty()) {
if (!peerManager.hasSufficientConnections()) {
log.debug("There are remaining nodes available for requesting peers. " +
"We will try getReportedPeers again.");
NodeAddress nextCandidate = remainingNodeAddresses.get(new Random().nextInt(remainingNodeAddresses.size()));
remainingNodeAddresses.remove(nextCandidate);
requestReportedPeers(nextCandidate, remainingNodeAddresses);
} else {
// That path will rarely be reached
log.debug("We have already sufficient connections.");
}
} else {
log.debug("There is no remaining node available for requesting peers. " +
"That is expected if no other node is online.\n\t" +
"We will try again after a pause.");
if (retryTimer == null)
retryTimer = UserThread.runAfter(() -> {
if (!stopped) {
log.trace("retryTimer called from requestReportedPeers code path");
stopRetryTimer();
requestWithAvailablePeers();
} else {
stopRetryTimer();
log.warn("We have stopped already. We ignore that retryTimer.run call.");
}
}, RETRY_DELAY_SEC);
}
}
});
handlerMap.put(nodeAddress, peerExchangeHandler);
peerExchangeHandler.sendGetPeersRequestAfterRandomDelay(nodeAddress);
} else {
log.trace("We have started already a peerExchangeHandler. " +
"We ignore that call. nodeAddress=" + nodeAddress);
"We ignore that call. nodeAddress=" + nodeAddress);
}
} else {
log.trace("We have stopped already. We ignore that requestReportedPeers call.");
@ -302,7 +312,7 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
stopped = false;
if (periodicTimer == null)
periodicTimer = UserThread.runPeriodically(this::requestWithAvailablePeers,
REQUEST_PERIODICALLY_INTERVAL_SEC, TimeUnit.SECONDS);
REQUEST_PERIODICALLY_INTERVAL_MIN, TimeUnit.MINUTES);
}
private void restart() {
@ -322,22 +332,22 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
private List<NodeAddress> getNodeAddresses(Collection<Peer> collection) {
return collection.stream()
.map(Peer::getNodeAddress)
.collect(Collectors.toList());
.map(Peer::getNodeAddress)
.collect(Collectors.toList());
}
private List<NodeAddress> getFilteredList(Collection<NodeAddress> collection, List<NodeAddress> list) {
return collection.stream()
.filter(e -> !list.contains(e) &&
!peerManager.isSelf(e) &&
!peerManager.isConfirmed(e))
.collect(Collectors.toList());
.filter(e -> !list.contains(e) &&
!peerManager.isSelf(e) &&
!peerManager.isConfirmed(e))
.collect(Collectors.toList());
}
private List<NodeAddress> getFilteredNonSeedNodeList(Collection<NodeAddress> collection, List<NodeAddress> list) {
return getFilteredList(collection, list).stream()
.filter(e -> !peerManager.isSeedNode(e))
.collect(Collectors.toList());
.filter(e -> !peerManager.isSeedNode(e))
.collect(Collectors.toList());
}
private void stopPeriodicTimer() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View file

@ -1,74 +0,0 @@
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Bisq with application files
[Setup]
AppId={{bisq}}
AppName=Bisq
AppVersion=0.6.2
AppVerName=Bisq
AppPublisher=Bisq
AppComments=Bisq
AppCopyright=Copyright (C) 2016
AppPublisherURL=https://bisq.network
AppSupportURL=https://bisq.network
;AppUpdatesURL=http://java.com/
DefaultDirName={localappdata}\Bisq
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableWelcomePage=Yes
DefaultGroupName=Bisq
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename=Bisq
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=C:\Users\asd\Desktop\exchange\package\win\64bit\Bisq.ico
UninstallDisplayIcon={app}\Bisq.ico
UninstallDisplayName=Bisq
WizardImageStretch=No
WizardSmallImageFile=Bisq-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=Yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "Bisq\Bisq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bisq\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"; Check: returnTrue()
Name: "{commondesktop}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"; Check: returnFalse()
[Run]
Filename: "{app}\Bisq.exe"; Description: "{cm:LaunchProgram,Bisq}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\Bisq.exe"; Parameters: "-install -svcName ""Bisq"" -svcDesc ""Bisq"" -mainExe ""Bisq.exe"" "; Check: returnFalse()
[UninstallRun]
Filename: "{app}\Bisq.exe "; Parameters: "-uninstall -svcName Bisq -stopOnUninstall"; Check: returnFalse()
[Code]
function returnTrue(): Boolean;
begin
Result := True;
end;
function returnFalse(): Boolean;
begin
Result := False;
end;
function InitializeSetup(): Boolean;
begin
// Possible future improvements:
// if version less or same => just launch app
// if upgrade => check if same app is running and wait for it to exit
// Add pack200/unpack200 support?
Result := True;
end;

View file

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -27,9 +27,9 @@ OutputBaseFilename=Bisq
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=C:\Users\mk\Desktop\exchange\package\win\32bit\Bisq.ico
SetupIconFile=Bisq\Bisq.ico
UninstallDisplayIcon={app}\Bisq.ico
UninstallDisplayName=Bisq
UninstallDisplayName=Bisq
WizardImageStretch=No
WizardSmallImageFile=Bisq-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64

View file

@ -86,13 +86,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>3.1.0</version>
<configuration>
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
<minimizeJar>false</minimizeJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>io.bisq.provider.ProviderMain</Main-Class>
<!-- the specified bouncy castle jar classes -->

View file

@ -18,5 +18,5 @@
package io.bisq.provider;
public class ProviderVersion {
public static final String VERSION = "0.6.3";
public static final String VERSION = "0.6.4";
}

View file

@ -86,13 +86,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>3.1.0</version>
<configuration>
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
<minimizeJar>false</minimizeJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>io.bisq.seednode.SeedNodeMain</Main-Class>
<!-- the specified bouncy castle jar classes -->

View file

@ -37,7 +37,7 @@ import java.util.Arrays;
@Slf4j
public class SeedNode {
public static final String VERSION = "0.6.2";
public static final String VERSION = "0.6.3";
private static BisqEnvironment bisqEnvironment;
public static void setEnvironment(BisqEnvironment bisqEnvironment) {

View file

@ -85,13 +85,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<version>3.1.0</version>
<configuration>
<!-- broken with Java 8 (MSHADE-174), using ProGuard instead. -->
<minimizeJar>false</minimizeJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>io.bisq.statistics.StatisticsMain</Main-Class>
<!-- the specified bouncy castle jar classes -->

View file

@ -41,8 +41,7 @@ import java.util.Arrays;
@Slf4j
public class Statistics {
// Bisq v0.6.1 did not change anything relevant for that project so we stick with 0.6.0
public static final String VERSION = "0.6.0";
public static final String VERSION = "0.6.1";
private static BisqEnvironment bisqEnvironment;
public static void setEnvironment(BisqEnvironment bisqEnvironment) {