mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-11 16:54:39 -05:00
update to monero-java 0.6.0 with api updates & connection manager fixes
This commit is contained in:
parent
800b309a4b
commit
7b6b92d894
@ -40,7 +40,7 @@ configure(subprojects) {
|
||||
grpcVersion = '1.25.0'
|
||||
gsonVersion = '2.8.5'
|
||||
guavaVersion = '28.2-jre'
|
||||
moneroJavaVersion = '0.5.11'
|
||||
moneroJavaVersion = '0.6.0'
|
||||
httpclient5Version = '5.0'
|
||||
guiceVersion = '4.2.2'
|
||||
hamcrestVersion = '1.3'
|
||||
|
@ -100,7 +100,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
|
||||
import monero.daemon.MoneroDaemon;
|
||||
import monero.daemon.model.MoneroDaemonConnection;
|
||||
import monero.daemon.model.MoneroPeer;
|
||||
import monero.wallet.MoneroWallet;
|
||||
|
||||
// Setup wallets and use WalletConfig for BitcoinJ wiring.
|
||||
@ -136,7 +136,7 @@ public class WalletsSetup {
|
||||
private final int socks5DiscoverMode;
|
||||
private final IntegerProperty numPeers = new SimpleIntegerProperty(0);
|
||||
private final LongProperty chainHeight = new SimpleLongProperty(0);
|
||||
private final ObjectProperty<List<MoneroDaemonConnection>> peerConnections = new SimpleObjectProperty<>();
|
||||
private final ObjectProperty<List<MoneroPeer>> peers = new SimpleObjectProperty<>();
|
||||
private final DownloadListener downloadListener = new DownloadListener();
|
||||
private final List<Runnable> setupCompletedHandlers = new ArrayList<>();
|
||||
public final BooleanProperty shutDownComplete = new SimpleBooleanProperty();
|
||||
@ -220,8 +220,8 @@ public class WalletsSetup {
|
||||
peerGroup.setAddPeersFromAddressMessage(false);
|
||||
|
||||
UserThread.runPeriodically(() -> {
|
||||
peerConnections.set(getPeerConnections());
|
||||
numPeers.set(peerConnections.get().size());
|
||||
peers.set(getPeerConnections());
|
||||
numPeers.set(peers.get().size());
|
||||
chainHeight.set(vXmrDaemon.getHeight());
|
||||
}, DAEMON_POLL_INTERVAL_SECONDS);
|
||||
|
||||
@ -240,8 +240,8 @@ public class WalletsSetup {
|
||||
|
||||
// Map to user thread
|
||||
UserThread.execute(() -> {
|
||||
peerConnections.set(getPeerConnections());
|
||||
numPeers.set(peerConnections.get().size());
|
||||
peers.set(getPeerConnections());
|
||||
numPeers.set(peers.get().size());
|
||||
chainHeight.set(vXmrDaemon.getHeight());
|
||||
addressEntryList.onWalletReady(walletConfig.btcWallet());
|
||||
xmrAddressEntryList.onWalletReady(walletConfig.getXmrWallet());
|
||||
@ -253,9 +253,9 @@ public class WalletsSetup {
|
||||
UserThread.runAfter(resultHandler::handleResult, 100, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private List<MoneroDaemonConnection> getPeerConnections() {
|
||||
return vXmrDaemon.getConnections().stream()
|
||||
.filter(peerConnection -> peerConnection.getPeer().isOnline())
|
||||
private List<MoneroPeer> getPeerConnections() {
|
||||
return vXmrDaemon.getPeers().stream()
|
||||
.filter(peer -> peer.isOnline())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
};
|
||||
@ -506,8 +506,8 @@ public class WalletsSetup {
|
||||
return numPeers;
|
||||
}
|
||||
|
||||
public ReadOnlyObjectProperty<List<MoneroDaemonConnection>> peerConnectionsProperty() {
|
||||
return peerConnections;
|
||||
public ReadOnlyObjectProperty<List<MoneroPeer>> peerConnectionsProperty() {
|
||||
return peers;
|
||||
}
|
||||
|
||||
public LongProperty chainHeightProperty() {
|
||||
|
@ -17,17 +17,17 @@
|
||||
|
||||
package bisq.desktop.main.settings.network;
|
||||
|
||||
import monero.daemon.model.MoneroDaemonConnection;
|
||||
import monero.daemon.model.MoneroPeer;
|
||||
|
||||
public class MoneroNetworkListItem {
|
||||
private final MoneroDaemonConnection peerConnection;
|
||||
private final MoneroPeer peer;
|
||||
|
||||
public MoneroNetworkListItem(MoneroDaemonConnection peerConnection) {
|
||||
this.peerConnection = peerConnection;
|
||||
public MoneroNetworkListItem(MoneroPeer peer) {
|
||||
this.peer = peer;
|
||||
}
|
||||
|
||||
public String getOnionAddress() {
|
||||
return peerConnection.getPeer().getHost() + ":" + peerConnection.getPeer().getPort();
|
||||
return peer.getHost() + ":" + peer.getPort();
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
@ -39,6 +39,6 @@ public class MoneroNetworkListItem {
|
||||
}
|
||||
|
||||
public String getHeight() {
|
||||
return String.valueOf(peerConnection.getHeight());
|
||||
return String.valueOf(peer.getHeight());
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||
|
||||
import monero.daemon.model.MoneroDaemonConnection;
|
||||
import monero.daemon.model.MoneroPeer;
|
||||
|
||||
@FxmlView
|
||||
public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
@ -480,9 +480,9 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private void updateMoneroPeersTable(List<MoneroDaemonConnection> peerConnections) {
|
||||
private void updateMoneroPeersTable(List<MoneroPeer> peers) {
|
||||
moneroNetworkListItems.clear();
|
||||
moneroNetworkListItems.setAll(peerConnections.stream()
|
||||
moneroNetworkListItems.setAll(peers.stream()
|
||||
.map(MoneroNetworkListItem::new)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user