update to monero-java 0.6.0 with api updates & connection manager fixes

This commit is contained in:
woodser 2022-01-13 14:03:20 -05:00
parent 800b309a4b
commit 7b6b92d894
4 changed files with 21 additions and 21 deletions

View file

@ -40,7 +40,7 @@ configure(subprojects) {
grpcVersion = '1.25.0' grpcVersion = '1.25.0'
gsonVersion = '2.8.5' gsonVersion = '2.8.5'
guavaVersion = '28.2-jre' guavaVersion = '28.2-jre'
moneroJavaVersion = '0.5.11' moneroJavaVersion = '0.6.0'
httpclient5Version = '5.0' httpclient5Version = '5.0'
guiceVersion = '4.2.2' guiceVersion = '4.2.2'
hamcrestVersion = '1.3' hamcrestVersion = '1.3'

View file

@ -100,7 +100,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import monero.daemon.MoneroDaemon; import monero.daemon.MoneroDaemon;
import monero.daemon.model.MoneroDaemonConnection; import monero.daemon.model.MoneroPeer;
import monero.wallet.MoneroWallet; import monero.wallet.MoneroWallet;
// Setup wallets and use WalletConfig for BitcoinJ wiring. // Setup wallets and use WalletConfig for BitcoinJ wiring.
@ -136,7 +136,7 @@ public class WalletsSetup {
private final int socks5DiscoverMode; private final int socks5DiscoverMode;
private final IntegerProperty numPeers = new SimpleIntegerProperty(0); private final IntegerProperty numPeers = new SimpleIntegerProperty(0);
private final LongProperty chainHeight = new SimpleLongProperty(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 DownloadListener downloadListener = new DownloadListener();
private final List<Runnable> setupCompletedHandlers = new ArrayList<>(); private final List<Runnable> setupCompletedHandlers = new ArrayList<>();
public final BooleanProperty shutDownComplete = new SimpleBooleanProperty(); public final BooleanProperty shutDownComplete = new SimpleBooleanProperty();
@ -220,8 +220,8 @@ public class WalletsSetup {
peerGroup.setAddPeersFromAddressMessage(false); peerGroup.setAddPeersFromAddressMessage(false);
UserThread.runPeriodically(() -> { UserThread.runPeriodically(() -> {
peerConnections.set(getPeerConnections()); peers.set(getPeerConnections());
numPeers.set(peerConnections.get().size()); numPeers.set(peers.get().size());
chainHeight.set(vXmrDaemon.getHeight()); chainHeight.set(vXmrDaemon.getHeight());
}, DAEMON_POLL_INTERVAL_SECONDS); }, DAEMON_POLL_INTERVAL_SECONDS);
@ -240,8 +240,8 @@ public class WalletsSetup {
// Map to user thread // Map to user thread
UserThread.execute(() -> { UserThread.execute(() -> {
peerConnections.set(getPeerConnections()); peers.set(getPeerConnections());
numPeers.set(peerConnections.get().size()); numPeers.set(peers.get().size());
chainHeight.set(vXmrDaemon.getHeight()); chainHeight.set(vXmrDaemon.getHeight());
addressEntryList.onWalletReady(walletConfig.btcWallet()); addressEntryList.onWalletReady(walletConfig.btcWallet());
xmrAddressEntryList.onWalletReady(walletConfig.getXmrWallet()); xmrAddressEntryList.onWalletReady(walletConfig.getXmrWallet());
@ -253,9 +253,9 @@ public class WalletsSetup {
UserThread.runAfter(resultHandler::handleResult, 100, TimeUnit.MILLISECONDS); UserThread.runAfter(resultHandler::handleResult, 100, TimeUnit.MILLISECONDS);
} }
private List<MoneroDaemonConnection> getPeerConnections() { private List<MoneroPeer> getPeerConnections() {
return vXmrDaemon.getConnections().stream() return vXmrDaemon.getPeers().stream()
.filter(peerConnection -> peerConnection.getPeer().isOnline()) .filter(peer -> peer.isOnline())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
}; };
@ -506,8 +506,8 @@ public class WalletsSetup {
return numPeers; return numPeers;
} }
public ReadOnlyObjectProperty<List<MoneroDaemonConnection>> peerConnectionsProperty() { public ReadOnlyObjectProperty<List<MoneroPeer>> peerConnectionsProperty() {
return peerConnections; return peers;
} }
public LongProperty chainHeightProperty() { public LongProperty chainHeightProperty() {

View file

@ -17,17 +17,17 @@
package bisq.desktop.main.settings.network; package bisq.desktop.main.settings.network;
import monero.daemon.model.MoneroDaemonConnection; import monero.daemon.model.MoneroPeer;
public class MoneroNetworkListItem { public class MoneroNetworkListItem {
private final MoneroDaemonConnection peerConnection; private final MoneroPeer peer;
public MoneroNetworkListItem(MoneroDaemonConnection peerConnection) { public MoneroNetworkListItem(MoneroPeer peer) {
this.peerConnection = peerConnection; this.peer = peer;
} }
public String getOnionAddress() { public String getOnionAddress() {
return peerConnection.getPeer().getHost() + ":" + peerConnection.getPeer().getPort(); return peer.getHost() + ":" + peer.getPort();
} }
public String getVersion() { public String getVersion() {
@ -39,6 +39,6 @@ public class MoneroNetworkListItem {
} }
public String getHeight() { public String getHeight() {
return String.valueOf(peerConnection.getHeight()); return String.valueOf(peer.getHeight());
} }
} }

View file

@ -77,7 +77,7 @@ import java.util.stream.Collectors;
import static javafx.beans.binding.Bindings.createStringBinding; import static javafx.beans.binding.Bindings.createStringBinding;
import monero.daemon.model.MoneroDaemonConnection; import monero.daemon.model.MoneroPeer;
@FxmlView @FxmlView
public class NetworkSettingsView extends ActivatableView<GridPane, Void> { public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
@ -480,9 +480,9 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
private void updateMoneroPeersTable(List<MoneroDaemonConnection> peerConnections) { private void updateMoneroPeersTable(List<MoneroPeer> peers) {
moneroNetworkListItems.clear(); moneroNetworkListItems.clear();
moneroNetworkListItems.setAll(peerConnections.stream() moneroNetworkListItems.setAll(peers.stream()
.map(MoneroNetworkListItem::new) .map(MoneroNetworkListItem::new)
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }