This commit is contained in:
Manfred Karrer 2019-05-11 12:55:29 +02:00
parent fa07957c24
commit 96138e759b
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
3 changed files with 8 additions and 17 deletions

View File

@ -272,7 +272,7 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ
nodeAddressSubscription = EasyBind.subscribe(p2PService.getNetworkNode().nodeAddressProperty(),
nodeAddress -> onionAddress.setText(nodeAddress == null ?
Res.get("settings.net.notKnownYet") :
p2PService.getAddress().getFullAddress()));
nodeAddress.getFullAddress()));
numP2PPeersSubscription = EasyBind.subscribe(p2PService.getNumConnectedPeers(), numPeers -> updateP2PTable());
totalTrafficTextField.textProperty().bind(EasyBind.combine(Statistic.totalSentBytesProperty(),
Statistic.totalReceivedBytesProperty(),

View File

@ -455,9 +455,4 @@ public abstract class NetworkNode implements MessageListener {
public NodeAddress getNodeAddress() {
return nodeAddressProperty.get();
}
@Nullable
public ObjectProperty<NodeAddress> getNodeAddressProperty() {
return nodeAddressProperty;
}
}

View File

@ -35,8 +35,6 @@ import bisq.common.proto.network.NetworkEnvelope;
import javax.inject.Inject;
import javafx.beans.property.SimpleObjectProperty;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -119,15 +117,13 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
this.seedNodeAddresses = new HashSet<>(seedNodeRepository.getSeedNodeAddresses());
this.networkNode.getNodeAddressProperty().addListener(observable -> {
NodeAddress myAddress = (NodeAddress) ((SimpleObjectProperty) observable).get();
seedNodeAddresses.remove(myAddress);
if (myAddress != null && seedNodeRepository.isSeedNode(myAddress)) {
NUM_SEEDS_FOR_PRELIMINARY_REQUEST = 3;
NUM_ADDITIONAL_SEEDS_FOR_UPDATE_REQUEST = 2;
this.networkNode.nodeAddressProperty().addListener((observable, oldValue, myAddress) -> {
if (myAddress != null) {
seedNodeAddresses.remove(myAddress);
if (seedNodeRepository.isSeedNode(myAddress)) {
NUM_SEEDS_FOR_PRELIMINARY_REQUEST = 3;
NUM_ADDITIONAL_SEEDS_FOR_UPDATE_REQUEST = 2;
}
}
});
}