mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
rename services and objects from Monero to Xmr for consistency
This commit is contained in:
parent
497f987541
commit
644bb72957
52 changed files with 334 additions and 334 deletions
|
@ -43,7 +43,7 @@ import haveno.core.support.messages.ChatMessage;
|
||||||
import haveno.core.trade.Trade;
|
import haveno.core.trade.Trade;
|
||||||
import haveno.core.trade.statistics.TradeStatistics3;
|
import haveno.core.trade.statistics.TradeStatistics3;
|
||||||
import haveno.core.trade.statistics.TradeStatisticsManager;
|
import haveno.core.trade.statistics.TradeStatisticsManager;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.XmrNodeSettings;
|
||||||
import haveno.proto.grpc.NotificationMessage;
|
import haveno.proto.grpc.NotificationMessage;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -86,8 +86,8 @@ public class CoreApi {
|
||||||
private final CoreWalletsService walletsService;
|
private final CoreWalletsService walletsService;
|
||||||
private final TradeStatisticsManager tradeStatisticsManager;
|
private final TradeStatisticsManager tradeStatisticsManager;
|
||||||
private final CoreNotificationService notificationService;
|
private final CoreNotificationService notificationService;
|
||||||
private final CoreMoneroConnectionsService coreMoneroConnectionsService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
private final LocalMoneroNode coreMoneroNodeService;
|
private final XmrLocalNode xmrLocalNode;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CoreApi(Config config,
|
public CoreApi(Config config,
|
||||||
|
@ -103,8 +103,8 @@ public class CoreApi {
|
||||||
CoreWalletsService walletsService,
|
CoreWalletsService walletsService,
|
||||||
TradeStatisticsManager tradeStatisticsManager,
|
TradeStatisticsManager tradeStatisticsManager,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
CoreMoneroConnectionsService coreMoneroConnectionsService,
|
XmrConnectionService xmrConnectionService,
|
||||||
LocalMoneroNode coreMoneroNodeService) {
|
XmrLocalNode xmrLocalNode) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.appStartupState = appStartupState;
|
this.appStartupState = appStartupState;
|
||||||
this.coreAccountService = coreAccountService;
|
this.coreAccountService = coreAccountService;
|
||||||
|
@ -118,8 +118,8 @@ public class CoreApi {
|
||||||
this.walletsService = walletsService;
|
this.walletsService = walletsService;
|
||||||
this.tradeStatisticsManager = tradeStatisticsManager;
|
this.tradeStatisticsManager = tradeStatisticsManager;
|
||||||
this.notificationService = notificationService;
|
this.notificationService = notificationService;
|
||||||
this.coreMoneroConnectionsService = coreMoneroConnectionsService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.coreMoneroNodeService = coreMoneroNodeService;
|
this.xmrLocalNode = xmrLocalNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("SameReturnValue")
|
@SuppressWarnings("SameReturnValue")
|
||||||
|
@ -184,71 +184,71 @@ public class CoreApi {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public void addMoneroConnection(MoneroRpcConnection connection) {
|
public void addMoneroConnection(MoneroRpcConnection connection) {
|
||||||
coreMoneroConnectionsService.addConnection(connection);
|
xmrConnectionService.addConnection(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeMoneroConnection(String connectionUri) {
|
public void removeMoneroConnection(String connectionUri) {
|
||||||
coreMoneroConnectionsService.removeConnection(connectionUri);
|
xmrConnectionService.removeConnection(connectionUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoneroRpcConnection getMoneroConnection() {
|
public MoneroRpcConnection getMoneroConnection() {
|
||||||
return coreMoneroConnectionsService.getConnection();
|
return xmrConnectionService.getConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MoneroRpcConnection> getMoneroConnections() {
|
public List<MoneroRpcConnection> getXmrConnections() {
|
||||||
return coreMoneroConnectionsService.getConnections();
|
return xmrConnectionService.getConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMoneroConnection(String connectionUri) {
|
public void setMoneroConnection(String connectionUri) {
|
||||||
coreMoneroConnectionsService.setConnection(connectionUri);
|
xmrConnectionService.setConnection(connectionUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMoneroConnection(MoneroRpcConnection connection) {
|
public void setMoneroConnection(MoneroRpcConnection connection) {
|
||||||
coreMoneroConnectionsService.setConnection(connection);
|
xmrConnectionService.setConnection(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoneroRpcConnection checkMoneroConnection() {
|
public MoneroRpcConnection checkMoneroConnection() {
|
||||||
return coreMoneroConnectionsService.checkConnection();
|
return xmrConnectionService.checkConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MoneroRpcConnection> checkMoneroConnections() {
|
public List<MoneroRpcConnection> checkXmrConnections() {
|
||||||
return coreMoneroConnectionsService.checkConnections();
|
return xmrConnectionService.checkConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startCheckingMoneroConnection(Long refreshPeriod) {
|
public void startCheckingMoneroConnection(Long refreshPeriod) {
|
||||||
coreMoneroConnectionsService.startCheckingConnection(refreshPeriod);
|
xmrConnectionService.startCheckingConnection(refreshPeriod);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopCheckingMoneroConnection() {
|
public void stopCheckingMoneroConnection() {
|
||||||
coreMoneroConnectionsService.stopCheckingConnection();
|
xmrConnectionService.stopCheckingConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoneroRpcConnection getBestAvailableMoneroConnection() {
|
public MoneroRpcConnection getBestAvailableMoneroConnection() {
|
||||||
return coreMoneroConnectionsService.getBestAvailableConnection();
|
return xmrConnectionService.getBestAvailableConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMoneroConnectionAutoSwitch(boolean autoSwitch) {
|
public void setMoneroConnectionAutoSwitch(boolean autoSwitch) {
|
||||||
coreMoneroConnectionsService.setAutoSwitch(autoSwitch);
|
xmrConnectionService.setAutoSwitch(autoSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Monero node
|
// Monero node
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public boolean isMoneroNodeOnline() {
|
public boolean isXmrNodeOnline() {
|
||||||
return coreMoneroNodeService.isDetected();
|
return xmrLocalNode.isDetected();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoneroNodeSettings getMoneroNodeSettings() {
|
public XmrNodeSettings getXmrNodeSettings() {
|
||||||
return coreMoneroNodeService.getMoneroNodeSettings();
|
return xmrLocalNode.getNodeSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startMoneroNode(MoneroNodeSettings settings) throws IOException {
|
public void startXmrNode(XmrNodeSettings settings) throws IOException {
|
||||||
coreMoneroNodeService.startMoneroNode(settings);
|
xmrLocalNode.startNode(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopMoneroNode() {
|
public void stopXmrNode() {
|
||||||
coreMoneroNodeService.stopMoneroNode();
|
xmrLocalNode.stopNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -42,7 +42,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public final class CoreMoneroConnectionsService {
|
public final class XmrConnectionService {
|
||||||
|
|
||||||
private static final int MIN_BROADCAST_CONNECTIONS = 0; // TODO: 0 for stagenet, 5+ for mainnet
|
private static final int MIN_BROADCAST_CONNECTIONS = 0; // TODO: 0 for stagenet, 5+ for mainnet
|
||||||
private static final long REFRESH_PERIOD_HTTP_MS = 20000; // refresh period when connected to remote node over http
|
private static final long REFRESH_PERIOD_HTTP_MS = 20000; // refresh period when connected to remote node over http
|
||||||
|
@ -57,7 +57,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final CoreAccountService accountService;
|
private final CoreAccountService accountService;
|
||||||
private final XmrNodes xmrNodes;
|
private final XmrNodes xmrNodes;
|
||||||
private final LocalMoneroNode nodeService;
|
private final XmrLocalNode xmrLocalNode;
|
||||||
private final MoneroConnectionManager connectionManager;
|
private final MoneroConnectionManager connectionManager;
|
||||||
private final EncryptedConnectionList connectionList;
|
private final EncryptedConnectionList connectionList;
|
||||||
private final ObjectProperty<List<MoneroPeer>> peers = new SimpleObjectProperty<>();
|
private final ObjectProperty<List<MoneroPeer>> peers = new SimpleObjectProperty<>();
|
||||||
|
@ -76,14 +76,14 @@ public final class CoreMoneroConnectionsService {
|
||||||
private List<MoneroConnectionManagerListener> listeners = new ArrayList<>();
|
private List<MoneroConnectionManagerListener> listeners = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CoreMoneroConnectionsService(P2PService p2PService,
|
public XmrConnectionService(P2PService p2PService,
|
||||||
Config config,
|
Config config,
|
||||||
CoreContext coreContext,
|
CoreContext coreContext,
|
||||||
Preferences preferences,
|
Preferences preferences,
|
||||||
WalletsSetup walletsSetup,
|
WalletsSetup walletsSetup,
|
||||||
CoreAccountService accountService,
|
CoreAccountService accountService,
|
||||||
XmrNodes xmrNodes,
|
XmrNodes xmrNodes,
|
||||||
LocalMoneroNode nodeService,
|
XmrLocalNode xmrLocalNode,
|
||||||
MoneroConnectionManager connectionManager,
|
MoneroConnectionManager connectionManager,
|
||||||
EncryptedConnectionList connectionList,
|
EncryptedConnectionList connectionList,
|
||||||
Socks5ProxyProvider socks5ProxyProvider) {
|
Socks5ProxyProvider socks5ProxyProvider) {
|
||||||
|
@ -92,7 +92,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
this.accountService = accountService;
|
this.accountService = accountService;
|
||||||
this.xmrNodes = xmrNodes;
|
this.xmrNodes = xmrNodes;
|
||||||
this.nodeService = nodeService;
|
this.xmrLocalNode = xmrLocalNode;
|
||||||
this.connectionManager = connectionManager;
|
this.connectionManager = connectionManager;
|
||||||
this.connectionList = connectionList;
|
this.connectionList = connectionList;
|
||||||
this.socks5ProxyProvider = socks5ProxyProvider;
|
this.socks5ProxyProvider = socks5ProxyProvider;
|
||||||
|
@ -313,10 +313,10 @@ public final class CoreMoneroConnectionsService {
|
||||||
|
|
||||||
private long getDefaultRefreshPeriodMs() {
|
private long getDefaultRefreshPeriodMs() {
|
||||||
MoneroRpcConnection connection = getConnection();
|
MoneroRpcConnection connection = getConnection();
|
||||||
if (connection == null) return LocalMoneroNode.REFRESH_PERIOD_LOCAL_MS;
|
if (connection == null) return XmrLocalNode.REFRESH_PERIOD_LOCAL_MS;
|
||||||
if (isConnectionLocal(connection)) {
|
if (isConnectionLocal(connection)) {
|
||||||
if (lastInfo != null && (lastInfo.isBusySyncing() || (lastInfo.getHeightWithoutBootstrap() != null && lastInfo.getHeightWithoutBootstrap() > 0 && lastInfo.getHeightWithoutBootstrap() < lastInfo.getHeight()))) return REFRESH_PERIOD_HTTP_MS; // refresh slower if syncing or bootstrapped
|
if (lastInfo != null && (lastInfo.isBusySyncing() || (lastInfo.getHeightWithoutBootstrap() != null && lastInfo.getHeightWithoutBootstrap() > 0 && lastInfo.getHeightWithoutBootstrap() < lastInfo.getHeight()))) return REFRESH_PERIOD_HTTP_MS; // refresh slower if syncing or bootstrapped
|
||||||
else return LocalMoneroNode.REFRESH_PERIOD_LOCAL_MS; // TODO: announce faster refresh after done syncing
|
else return XmrLocalNode.REFRESH_PERIOD_LOCAL_MS; // TODO: announce faster refresh after done syncing
|
||||||
} else if (useProxy(connection)) {
|
} else if (useProxy(connection)) {
|
||||||
return REFRESH_PERIOD_ONION_MS;
|
return REFRESH_PERIOD_ONION_MS;
|
||||||
} else {
|
} else {
|
||||||
|
@ -366,7 +366,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
|
|
||||||
// register local node listener
|
// register local node listener
|
||||||
nodeService.addListener(new LocalMoneroNodeListener() {
|
xmrLocalNode.addListener(new XmrLocalNodeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onNodeStarted(MoneroDaemonRpc daemon) {
|
public void onNodeStarted(MoneroDaemonRpc daemon) {
|
||||||
log.info("Local monero node started");
|
log.info("Local monero node started");
|
||||||
|
@ -381,7 +381,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
public void onConnectionChanged(MoneroRpcConnection connection) {
|
public void onConnectionChanged(MoneroRpcConnection connection) {
|
||||||
log.info("Local monerod connection changed: " + connection);
|
log.info("Local monerod connection changed: " + connection);
|
||||||
if (isShutDownStarted || !connectionManager.getAutoSwitch() || !accountService.isAccountOpen()) return;
|
if (isShutDownStarted || !connectionManager.getAutoSwitch() || !accountService.isAccountOpen()) return;
|
||||||
if (nodeService.isConnected()) {
|
if (xmrLocalNode.isConnected()) {
|
||||||
setConnection(connection.getUri()); // switch to local node if connected
|
setConnection(connection.getUri()); // switch to local node if connected
|
||||||
} else if (getConnection() != null && getConnection().getUri().equals(connection.getUri())) {
|
} else if (getConnection() != null && getConnection().getUri().equals(connection.getUri())) {
|
||||||
setConnection(getBestAvailableConnection()); // switch to best available if disconnected from local node
|
setConnection(getBestAvailableConnection()); // switch to best available if disconnected from local node
|
||||||
|
@ -487,10 +487,10 @@ public final class CoreMoneroConnectionsService {
|
||||||
if (HavenoUtils.havenoSetup == null) return;
|
if (HavenoUtils.havenoSetup == null) return;
|
||||||
|
|
||||||
// start local node if offline and used as last connection
|
// start local node if offline and used as last connection
|
||||||
if (connectionManager.getConnection() != null && nodeService.equalsUri(connectionManager.getConnection().getUri()) && !nodeService.isDetected()) {
|
if (connectionManager.getConnection() != null && xmrLocalNode.equalsUri(connectionManager.getConnection().getUri()) && !xmrLocalNode.isDetected()) {
|
||||||
try {
|
try {
|
||||||
log.info("Starting local node");
|
log.info("Starting local node");
|
||||||
nodeService.startMoneroNode();
|
xmrLocalNode.startMoneroNode();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Unable to start local monero node: " + e.getMessage());
|
log.warn("Unable to start local monero node: " + e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -499,7 +499,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onConnectionChanged(MoneroRpcConnection currentConnection) {
|
private void onConnectionChanged(MoneroRpcConnection currentConnection) {
|
||||||
log.info("CoreMoneroConnectionsService.onConnectionChanged() uri={}, connected={}", currentConnection == null ? null : currentConnection.getUri(), currentConnection == null ? "false" : currentConnection.isConnected());
|
log.info("XmrConnectionService.onConnectionChanged() uri={}, connected={}", currentConnection == null ? null : currentConnection.getUri(), currentConnection == null ? "false" : currentConnection.isConnected());
|
||||||
if (isShutDownStarted) return;
|
if (isShutDownStarted) return;
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
if (currentConnection == null) {
|
if (currentConnection == null) {
|
|
@ -21,7 +21,7 @@ import haveno.common.config.Config;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.XmrNodeSettings;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import monero.common.MoneroConnectionManager;
|
import monero.common.MoneroConnectionManager;
|
||||||
import monero.common.MoneroUtils;
|
import monero.common.MoneroUtils;
|
||||||
|
@ -38,7 +38,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class LocalMoneroNode {
|
public class XmrLocalNode {
|
||||||
|
|
||||||
// constants
|
// constants
|
||||||
public static final long REFRESH_PERIOD_LOCAL_MS = 5000; // refresh period for local node
|
public static final long REFRESH_PERIOD_LOCAL_MS = 5000; // refresh period for local node
|
||||||
|
@ -52,7 +52,7 @@ public class LocalMoneroNode {
|
||||||
private MoneroConnectionManager connectionManager;
|
private MoneroConnectionManager connectionManager;
|
||||||
private final Config config;
|
private final Config config;
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final List<LocalMoneroNodeListener> listeners = new ArrayList<>();
|
private final List<XmrLocalNodeListener> listeners = new ArrayList<>();
|
||||||
|
|
||||||
// required arguments
|
// required arguments
|
||||||
private static final List<String> MONEROD_ARGS = new ArrayList<String>();
|
private static final List<String> MONEROD_ARGS = new ArrayList<String>();
|
||||||
|
@ -73,7 +73,7 @@ public class LocalMoneroNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public LocalMoneroNode(Config config, Preferences preferences) {
|
public XmrLocalNode(Config config, Preferences preferences) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
this.daemon = new MoneroDaemonRpc("http://" + HavenoUtils.LOOPBACK_HOST + ":" + rpcPort);
|
this.daemon = new MoneroDaemonRpc("http://" + HavenoUtils.LOOPBACK_HOST + ":" + rpcPort);
|
||||||
|
@ -105,11 +105,11 @@ public class LocalMoneroNode {
|
||||||
return config.ignoreLocalXmrNode;
|
return config.ignoreLocalXmrNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addListener(LocalMoneroNodeListener listener) {
|
public void addListener(XmrLocalNodeListener listener) {
|
||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean removeListener(LocalMoneroNodeListener listener) {
|
public boolean removeListener(XmrLocalNodeListener listener) {
|
||||||
return listeners.remove(listener);
|
return listeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,23 +144,23 @@ public class LocalMoneroNode {
|
||||||
connectionManager.checkConnection();
|
connectionManager.checkConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoneroNodeSettings getMoneroNodeSettings() {
|
public XmrNodeSettings getNodeSettings() {
|
||||||
return preferences.getMoneroNodeSettings();
|
return preferences.getXmrNodeSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a local Monero node from settings.
|
* Start a local Monero node from settings.
|
||||||
*/
|
*/
|
||||||
public void startMoneroNode() throws IOException {
|
public void startMoneroNode() throws IOException {
|
||||||
var settings = preferences.getMoneroNodeSettings();
|
var settings = preferences.getXmrNodeSettings();
|
||||||
this.startMoneroNode(settings);
|
this.startNode(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start local Monero node. Throws MoneroError if the node cannot be started.
|
* Start local Monero node. Throws MoneroError if the node cannot be started.
|
||||||
* Persist the settings to preferences if the node started successfully.
|
* Persist the settings to preferences if the node started successfully.
|
||||||
*/
|
*/
|
||||||
public void startMoneroNode(MoneroNodeSettings settings) throws IOException {
|
public void startNode(XmrNodeSettings settings) throws IOException {
|
||||||
if (isDetected()) throw new IllegalStateException("Local Monero node already online");
|
if (isDetected()) throw new IllegalStateException("Local Monero node already online");
|
||||||
|
|
||||||
log.info("Starting local Monero node: " + settings);
|
log.info("Starting local Monero node: " + settings);
|
||||||
|
@ -184,15 +184,15 @@ public class LocalMoneroNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
daemon = new MoneroDaemonRpc(args); // start daemon as process and re-assign client
|
daemon = new MoneroDaemonRpc(args); // start daemon as process and re-assign client
|
||||||
preferences.setMoneroNodeSettings(settings);
|
preferences.setXmrNodeSettings(settings);
|
||||||
for (var listener : listeners) listener.onNodeStarted(daemon);
|
for (var listener : listeners) listener.onNodeStarted(daemon);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop the current local Monero node if we own its process.
|
* Stop the current local Monero node if we own its process.
|
||||||
* Does not remove the last MoneroNodeSettings.
|
* Does not remove the last XmrNodeSettings.
|
||||||
*/
|
*/
|
||||||
public void stopMoneroNode() {
|
public void stopNode() {
|
||||||
if (!isDetected()) throw new IllegalStateException("Local Monero node is not running");
|
if (!isDetected()) throw new IllegalStateException("Local Monero node is not running");
|
||||||
if (daemon.getProcess() == null || !daemon.getProcess().isAlive()) throw new IllegalStateException("Cannot stop local Monero node because we don't own its process"); // TODO (woodser): remove isAlive() check after monero-java 0.5.4 which nullifies internal process
|
if (daemon.getProcess() == null || !daemon.getProcess().isAlive()) throw new IllegalStateException("Cannot stop local Monero node because we don't own its process"); // TODO (woodser): remove isAlive() check after monero-java 0.5.4 which nullifies internal process
|
||||||
daemon.stopProcess();
|
daemon.stopProcess();
|
|
@ -19,7 +19,7 @@ package haveno.core.api;
|
||||||
import monero.common.MoneroRpcConnection;
|
import monero.common.MoneroRpcConnection;
|
||||||
import monero.daemon.MoneroDaemonRpc;
|
import monero.daemon.MoneroDaemonRpc;
|
||||||
|
|
||||||
public class LocalMoneroNodeListener {
|
public class XmrLocalNodeListener {
|
||||||
public void onNodeStarted(MoneroDaemonRpc daemon) {}
|
public void onNodeStarted(MoneroDaemonRpc daemon) {}
|
||||||
public void onNodeStopped() {}
|
public void onNodeStopped() {}
|
||||||
public void onConnectionChanged(MoneroRpcConnection connection) {}
|
public void onConnectionChanged(MoneroRpcConnection connection) {}
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import haveno.network.p2p.BootstrapListener;
|
import haveno.network.p2p.BootstrapListener;
|
||||||
|
@ -53,7 +53,7 @@ public class AppStartupState {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AppStartupState(CoreNotificationService notificationService,
|
public AppStartupState(CoreNotificationService notificationService,
|
||||||
CoreMoneroConnectionsService connectionsService,
|
XmrConnectionService xmrConnectionService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
P2PService p2PService) {
|
P2PService p2PService) {
|
||||||
|
|
||||||
|
@ -64,8 +64,8 @@ public class AppStartupState {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connectionsService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
|
xmrConnectionService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
if (connectionsService.isDownloadComplete())
|
if (xmrConnectionService.isDownloadComplete())
|
||||||
isBlockDownloadComplete.set(true);
|
isBlockDownloadComplete.set(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ public class AppStartupState {
|
||||||
isWalletSynced.set(true);
|
isWalletSynced.set(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
connectionsService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
|
xmrConnectionService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
if (connectionsService.hasSufficientPeersForBroadcast())
|
if (xmrConnectionService.hasSufficientPeersForBroadcast())
|
||||||
hasSufficientPeersForBroadcast.set(true);
|
hasSufficientPeersForBroadcast.set(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ import haveno.core.user.Preferences;
|
||||||
import haveno.core.util.FormattingUtils;
|
import haveno.core.util.FormattingUtils;
|
||||||
import haveno.core.util.coin.CoinFormatter;
|
import haveno.core.util.coin.CoinFormatter;
|
||||||
import haveno.core.util.coin.ImmutableCoinFormatter;
|
import haveno.core.util.coin.ImmutableCoinFormatter;
|
||||||
import haveno.core.xmr.MoneroConnectionModule;
|
import haveno.core.xmr.XmrConnectionModule;
|
||||||
import haveno.core.xmr.MoneroModule;
|
import haveno.core.xmr.XmrModule;
|
||||||
import haveno.network.crypto.EncryptionServiceModule;
|
import haveno.network.crypto.EncryptionServiceModule;
|
||||||
import haveno.network.p2p.P2PModule;
|
import haveno.network.p2p.P2PModule;
|
||||||
import haveno.network.p2p.network.BanFilter;
|
import haveno.network.p2p.network.BanFilter;
|
||||||
|
@ -88,10 +88,10 @@ public class CoreModule extends AppModule {
|
||||||
install(new EncryptionServiceModule(config));
|
install(new EncryptionServiceModule(config));
|
||||||
install(new OfferModule(config));
|
install(new OfferModule(config));
|
||||||
install(new P2PModule(config));
|
install(new P2PModule(config));
|
||||||
install(new MoneroModule(config));
|
install(new XmrModule(config));
|
||||||
install(new AlertModule(config));
|
install(new AlertModule(config));
|
||||||
install(new FilterModule(config));
|
install(new FilterModule(config));
|
||||||
install(new CorePresentationModule(config));
|
install(new CorePresentationModule(config));
|
||||||
install(new MoneroConnectionModule(config));
|
install(new XmrConnectionModule(config));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import haveno.common.setup.UncaughtExceptionHandler;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.api.AccountServiceListener;
|
import haveno.core.api.AccountServiceListener;
|
||||||
import haveno.core.api.CoreAccountService;
|
import haveno.core.api.CoreAccountService;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.offer.OfferBookService;
|
import haveno.core.offer.OfferBookService;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
|
@ -336,7 +336,7 @@ public abstract class HavenoExecutable implements GracefulShutDownHandler, Haven
|
||||||
// notify trade protocols and wallets to prepare for shut down before shutting down
|
// notify trade protocols and wallets to prepare for shut down before shutting down
|
||||||
Set<Runnable> tasks = new HashSet<Runnable>();
|
Set<Runnable> tasks = new HashSet<Runnable>();
|
||||||
tasks.add(() -> injector.getInstance(XmrWalletService.class).onShutDownStarted());
|
tasks.add(() -> injector.getInstance(XmrWalletService.class).onShutDownStarted());
|
||||||
tasks.add(() -> injector.getInstance(CoreMoneroConnectionsService.class).onShutDownStarted());
|
tasks.add(() -> injector.getInstance(XmrConnectionService.class).onShutDownStarted());
|
||||||
HavenoUtils.executeTasks(tasks); // notify in parallel
|
HavenoUtils.executeTasks(tasks); // notify in parallel
|
||||||
|
|
||||||
injector.getInstance(PriceFeedService.class).shutDown();
|
injector.getInstance(PriceFeedService.class).shutDown();
|
||||||
|
@ -363,7 +363,7 @@ public abstract class HavenoExecutable implements GracefulShutDownHandler, Haven
|
||||||
});
|
});
|
||||||
injector.getInstance(BtcWalletService.class).shutDown();
|
injector.getInstance(BtcWalletService.class).shutDown();
|
||||||
injector.getInstance(XmrWalletService.class).shutDown();
|
injector.getInstance(XmrWalletService.class).shutDown();
|
||||||
injector.getInstance(CoreMoneroConnectionsService.class).shutDown();
|
injector.getInstance(XmrConnectionService.class).shutDown();
|
||||||
injector.getInstance(WalletsSetup.class).shutDown();
|
injector.getInstance(WalletsSetup.class).shutDown();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,7 +33,7 @@ import haveno.core.alert.Alert;
|
||||||
import haveno.core.alert.AlertManager;
|
import haveno.core.alert.AlertManager;
|
||||||
import haveno.core.alert.PrivateNotificationManager;
|
import haveno.core.alert.PrivateNotificationManager;
|
||||||
import haveno.core.alert.PrivateNotificationPayload;
|
import haveno.core.alert.PrivateNotificationPayload;
|
||||||
import haveno.core.api.LocalMoneroNode;
|
import haveno.core.api.XmrLocalNode;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
import haveno.core.payment.AmazonGiftCardAccount;
|
import haveno.core.payment.AmazonGiftCardAccount;
|
||||||
|
@ -122,7 +122,7 @@ public class HavenoSetup {
|
||||||
private final AccountAgeWitnessService accountAgeWitnessService;
|
private final AccountAgeWitnessService accountAgeWitnessService;
|
||||||
private final TorSetup torSetup;
|
private final TorSetup torSetup;
|
||||||
private final CoinFormatter formatter;
|
private final CoinFormatter formatter;
|
||||||
private final LocalMoneroNode localMoneroNode;
|
private final XmrLocalNode xmrLocalNode;
|
||||||
private final AppStartupState appStartupState;
|
private final AppStartupState appStartupState;
|
||||||
private final MediationManager mediationManager;
|
private final MediationManager mediationManager;
|
||||||
private final RefundManager refundManager;
|
private final RefundManager refundManager;
|
||||||
|
@ -216,7 +216,7 @@ public class HavenoSetup {
|
||||||
AccountAgeWitnessService accountAgeWitnessService,
|
AccountAgeWitnessService accountAgeWitnessService,
|
||||||
TorSetup torSetup,
|
TorSetup torSetup,
|
||||||
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter,
|
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter,
|
||||||
LocalMoneroNode localMoneroNode,
|
XmrLocalNode xmrLocalNode,
|
||||||
AppStartupState appStartupState,
|
AppStartupState appStartupState,
|
||||||
Socks5ProxyProvider socks5ProxyProvider,
|
Socks5ProxyProvider socks5ProxyProvider,
|
||||||
MediationManager mediationManager,
|
MediationManager mediationManager,
|
||||||
|
@ -241,7 +241,7 @@ public class HavenoSetup {
|
||||||
this.accountAgeWitnessService = accountAgeWitnessService;
|
this.accountAgeWitnessService = accountAgeWitnessService;
|
||||||
this.torSetup = torSetup;
|
this.torSetup = torSetup;
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
this.localMoneroNode = localMoneroNode;
|
this.xmrLocalNode = xmrLocalNode;
|
||||||
this.appStartupState = appStartupState;
|
this.appStartupState = appStartupState;
|
||||||
this.mediationManager = mediationManager;
|
this.mediationManager = mediationManager;
|
||||||
this.refundManager = refundManager;
|
this.refundManager = refundManager;
|
||||||
|
@ -340,12 +340,12 @@ public class HavenoSetup {
|
||||||
|
|
||||||
private void maybeInstallDependencies() {
|
private void maybeInstallDependencies() {
|
||||||
try {
|
try {
|
||||||
File monerodFile = new File(LocalMoneroNode.MONEROD_PATH);
|
File monerodFile = new File(XmrLocalNode.MONEROD_PATH);
|
||||||
String monerodResourcePath = "bin/" + LocalMoneroNode.MONEROD_NAME;
|
String monerodResourcePath = "bin/" + XmrLocalNode.MONEROD_NAME;
|
||||||
if (!monerodFile.exists() || !FileUtil.resourceEqualToFile(monerodResourcePath, monerodFile)) {
|
if (!monerodFile.exists() || !FileUtil.resourceEqualToFile(monerodResourcePath, monerodFile)) {
|
||||||
log.info("Installing monerod");
|
log.info("Installing monerod");
|
||||||
monerodFile.getParentFile().mkdirs();
|
monerodFile.getParentFile().mkdirs();
|
||||||
FileUtil.resourceToFile("bin/" + LocalMoneroNode.MONEROD_NAME, monerodFile);
|
FileUtil.resourceToFile("bin/" + XmrLocalNode.MONEROD_NAME, monerodFile);
|
||||||
monerodFile.setExecutable(true);
|
monerodFile.setExecutable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,7 +622,7 @@ public class HavenoSetup {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeShowLocalhostRunningInfo() {
|
private void maybeShowLocalhostRunningInfo() {
|
||||||
maybeTriggerDisplayHandler("moneroLocalhostNode", displayLocalhostHandler, localMoneroNode.shouldBeUsed());
|
maybeTriggerDisplayHandler("xmrLocalNode", displayLocalhostHandler, xmrLocalNode.shouldBeUsed());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeShowAccountSigningStateInfo() {
|
private void maybeShowAccountSigningStateInfo() {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
package haveno.core.app;
|
package haveno.core.app;
|
||||||
|
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
|
@ -46,7 +46,7 @@ import java.util.function.Consumer;
|
||||||
public class P2PNetworkSetup {
|
public class P2PNetworkSetup {
|
||||||
private final PriceFeedService priceFeedService;
|
private final PriceFeedService priceFeedService;
|
||||||
private final P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
private final CoreMoneroConnectionsService connectionService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
|
|
||||||
@SuppressWarnings("FieldCanBeLocal")
|
@SuppressWarnings("FieldCanBeLocal")
|
||||||
|
@ -72,12 +72,12 @@ public class P2PNetworkSetup {
|
||||||
@Inject
|
@Inject
|
||||||
public P2PNetworkSetup(PriceFeedService priceFeedService,
|
public P2PNetworkSetup(PriceFeedService priceFeedService,
|
||||||
P2PService p2PService,
|
P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
Preferences preferences) {
|
Preferences preferences) {
|
||||||
|
|
||||||
this.priceFeedService = priceFeedService;
|
this.priceFeedService = priceFeedService;
|
||||||
this.p2PService = p2PService;
|
this.p2PService = p2PService;
|
||||||
this.connectionService = connectionService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class P2PNetworkSetup {
|
||||||
BooleanProperty initialP2PNetworkDataReceived = new SimpleBooleanProperty();
|
BooleanProperty initialP2PNetworkDataReceived = new SimpleBooleanProperty();
|
||||||
|
|
||||||
p2PNetworkInfoBinding = EasyBind.combine(bootstrapState, bootstrapWarning, p2PService.getNumConnectedPeers(),
|
p2PNetworkInfoBinding = EasyBind.combine(bootstrapState, bootstrapWarning, p2PService.getNumConnectedPeers(),
|
||||||
connectionService.numPeersProperty(), hiddenServicePublished, initialP2PNetworkDataReceived,
|
xmrConnectionService.numPeersProperty(), hiddenServicePublished, initialP2PNetworkDataReceived,
|
||||||
(state, warning, numP2pPeers, numXmrPeers, hiddenService, dataReceived) -> {
|
(state, warning, numP2pPeers, numXmrPeers, hiddenService, dataReceived) -> {
|
||||||
String result;
|
String result;
|
||||||
int p2pPeers = (int) numP2pPeers;
|
int p2pPeers = (int) numP2pPeers;
|
||||||
|
|
|
@ -20,7 +20,7 @@ package haveno.core.app;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.api.CoreContext;
|
import haveno.core.api.CoreContext;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
import haveno.core.trade.TradeManager;
|
import haveno.core.trade.TradeManager;
|
||||||
|
@ -60,7 +60,7 @@ public class WalletAppSetup {
|
||||||
private final CoreContext coreContext;
|
private final CoreContext coreContext;
|
||||||
private final WalletsManager walletsManager;
|
private final WalletsManager walletsManager;
|
||||||
private final WalletsSetup walletsSetup;
|
private final WalletsSetup walletsSetup;
|
||||||
private final CoreMoneroConnectionsService connectionService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
private final XmrWalletService xmrWalletService;
|
private final XmrWalletService xmrWalletService;
|
||||||
private final Config config;
|
private final Config config;
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
|
@ -85,14 +85,14 @@ public class WalletAppSetup {
|
||||||
public WalletAppSetup(CoreContext coreContext,
|
public WalletAppSetup(CoreContext coreContext,
|
||||||
WalletsManager walletsManager,
|
WalletsManager walletsManager,
|
||||||
WalletsSetup walletsSetup,
|
WalletsSetup walletsSetup,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
Config config,
|
Config config,
|
||||||
Preferences preferences) {
|
Preferences preferences) {
|
||||||
this.coreContext = coreContext;
|
this.coreContext = coreContext;
|
||||||
this.walletsManager = walletsManager;
|
this.walletsManager = walletsManager;
|
||||||
this.walletsSetup = walletsSetup;
|
this.walletsSetup = walletsSetup;
|
||||||
this.connectionService = connectionService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.xmrWalletService = xmrWalletService;
|
this.xmrWalletService = xmrWalletService;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
|
@ -107,8 +107,8 @@ public class WalletAppSetup {
|
||||||
log.info("Initialize WalletAppSetup with monero-java version {}", MoneroUtils.getVersion());
|
log.info("Initialize WalletAppSetup with monero-java version {}", MoneroUtils.getVersion());
|
||||||
|
|
||||||
ObjectProperty<Throwable> walletServiceException = new SimpleObjectProperty<>();
|
ObjectProperty<Throwable> walletServiceException = new SimpleObjectProperty<>();
|
||||||
xmrInfoBinding = EasyBind.combine(connectionService.downloadPercentageProperty(),
|
xmrInfoBinding = EasyBind.combine(xmrConnectionService.downloadPercentageProperty(),
|
||||||
connectionService.chainHeightProperty(),
|
xmrConnectionService.chainHeightProperty(),
|
||||||
xmrWalletService.downloadPercentageProperty(),
|
xmrWalletService.downloadPercentageProperty(),
|
||||||
xmrWalletService.walletHeightProperty(),
|
xmrWalletService.walletHeightProperty(),
|
||||||
walletServiceException,
|
walletServiceException,
|
||||||
|
|
|
@ -26,7 +26,7 @@ import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.common.setup.GracefulShutDownHandler;
|
import haveno.common.setup.GracefulShutDownHandler;
|
||||||
import haveno.common.util.Profiler;
|
import haveno.common.util.Profiler;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.app.HavenoExecutable;
|
import haveno.core.app.HavenoExecutable;
|
||||||
import haveno.core.offer.OfferBookService;
|
import haveno.core.offer.OfferBookService;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
|
@ -96,7 +96,7 @@ public abstract class ExecutableForAppWithP2p extends HavenoExecutable {
|
||||||
// notify trade protocols and wallets to prepare for shut down before shutting down
|
// notify trade protocols and wallets to prepare for shut down before shutting down
|
||||||
Set<Runnable> tasks = new HashSet<Runnable>();
|
Set<Runnable> tasks = new HashSet<Runnable>();
|
||||||
tasks.add(() -> injector.getInstance(XmrWalletService.class).onShutDownStarted());
|
tasks.add(() -> injector.getInstance(XmrWalletService.class).onShutDownStarted());
|
||||||
tasks.add(() -> injector.getInstance(CoreMoneroConnectionsService.class).onShutDownStarted());
|
tasks.add(() -> injector.getInstance(XmrConnectionService.class).onShutDownStarted());
|
||||||
HavenoUtils.executeTasks(tasks); // notify in parallel
|
HavenoUtils.executeTasks(tasks); // notify in parallel
|
||||||
|
|
||||||
JsonFileManager.shutDownAllInstances();
|
JsonFileManager.shutDownAllInstances();
|
||||||
|
@ -124,7 +124,7 @@ public abstract class ExecutableForAppWithP2p extends HavenoExecutable {
|
||||||
});
|
});
|
||||||
injector.getInstance(BtcWalletService.class).shutDown();
|
injector.getInstance(BtcWalletService.class).shutDown();
|
||||||
injector.getInstance(XmrWalletService.class).shutDown();
|
injector.getInstance(XmrWalletService.class).shutDown();
|
||||||
injector.getInstance(CoreMoneroConnectionsService.class).shutDown();
|
injector.getInstance(XmrConnectionService.class).shutDown();
|
||||||
injector.getInstance(WalletsSetup.class).shutDown();
|
injector.getInstance(WalletsSetup.class).shutDown();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,8 +36,8 @@ import haveno.core.proto.persistable.CorePersistenceProtoResolver;
|
||||||
import haveno.core.trade.TradeModule;
|
import haveno.core.trade.TradeModule;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.user.User;
|
import haveno.core.user.User;
|
||||||
import haveno.core.xmr.MoneroConnectionModule;
|
import haveno.core.xmr.XmrConnectionModule;
|
||||||
import haveno.core.xmr.MoneroModule;
|
import haveno.core.xmr.XmrModule;
|
||||||
import haveno.network.crypto.EncryptionServiceModule;
|
import haveno.network.crypto.EncryptionServiceModule;
|
||||||
import haveno.network.p2p.P2PModule;
|
import haveno.network.p2p.P2PModule;
|
||||||
import haveno.network.p2p.network.BanFilter;
|
import haveno.network.p2p.network.BanFilter;
|
||||||
|
@ -92,9 +92,9 @@ public class ModuleForAppWithP2p extends AppModule {
|
||||||
install(new EncryptionServiceModule(config));
|
install(new EncryptionServiceModule(config));
|
||||||
install(new OfferModule(config));
|
install(new OfferModule(config));
|
||||||
install(new P2PModule(config));
|
install(new P2PModule(config));
|
||||||
install(new MoneroModule(config));
|
install(new XmrModule(config));
|
||||||
install(new AlertModule(config));
|
install(new AlertModule(config));
|
||||||
install(new FilterModule(config));
|
install(new FilterModule(config));
|
||||||
install(new MoneroConnectionModule(config));
|
install(new XmrConnectionModule(config));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,13 +23,13 @@ import haveno.common.config.Config;
|
||||||
import haveno.common.file.JsonFileManager;
|
import haveno.common.file.JsonFileManager;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.core.util.JsonUtil;
|
import haveno.core.util.JsonUtil;
|
||||||
import haveno.core.xmr.wallet.MoneroKeyImageListener;
|
import haveno.core.xmr.wallet.XmrKeyImageListener;
|
||||||
import haveno.core.xmr.wallet.MoneroKeyImagePoller;
|
import haveno.core.xmr.wallet.XmrKeyImagePoller;
|
||||||
import haveno.network.p2p.BootstrapListener;
|
import haveno.network.p2p.BootstrapListener;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.storage.HashMapChangedListener;
|
import haveno.network.p2p.storage.HashMapChangedListener;
|
||||||
|
@ -63,10 +63,10 @@ public class OfferBookService {
|
||||||
private final List<OfferBookChangedListener> offerBookChangedListeners = new LinkedList<>();
|
private final List<OfferBookChangedListener> offerBookChangedListeners = new LinkedList<>();
|
||||||
private final FilterManager filterManager;
|
private final FilterManager filterManager;
|
||||||
private final JsonFileManager jsonFileManager;
|
private final JsonFileManager jsonFileManager;
|
||||||
private final CoreMoneroConnectionsService connectionsService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
|
|
||||||
// poll key images of offers
|
// poll key images of offers
|
||||||
private MoneroKeyImagePoller keyImagePoller;
|
private XmrKeyImagePoller keyImagePoller;
|
||||||
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL = 20000; // 20 seconds
|
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL = 20000; // 20 seconds
|
||||||
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE = 300000; // 5 minutes
|
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE = 300000; // 5 minutes
|
||||||
|
|
||||||
|
@ -84,21 +84,21 @@ public class OfferBookService {
|
||||||
public OfferBookService(P2PService p2PService,
|
public OfferBookService(P2PService p2PService,
|
||||||
PriceFeedService priceFeedService,
|
PriceFeedService priceFeedService,
|
||||||
FilterManager filterManager,
|
FilterManager filterManager,
|
||||||
CoreMoneroConnectionsService connectionsService,
|
XmrConnectionService xmrConnectionService,
|
||||||
@Named(Config.STORAGE_DIR) File storageDir,
|
@Named(Config.STORAGE_DIR) File storageDir,
|
||||||
@Named(Config.DUMP_STATISTICS) boolean dumpStatistics) {
|
@Named(Config.DUMP_STATISTICS) boolean dumpStatistics) {
|
||||||
this.p2PService = p2PService;
|
this.p2PService = p2PService;
|
||||||
this.priceFeedService = priceFeedService;
|
this.priceFeedService = priceFeedService;
|
||||||
this.filterManager = filterManager;
|
this.filterManager = filterManager;
|
||||||
this.connectionsService = connectionsService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
jsonFileManager = new JsonFileManager(storageDir);
|
jsonFileManager = new JsonFileManager(storageDir);
|
||||||
|
|
||||||
// listen for connection changes to monerod
|
// listen for connection changes to monerod
|
||||||
connectionsService.addConnectionListener(new MoneroConnectionManagerListener() {
|
xmrConnectionService.addConnectionListener(new MoneroConnectionManagerListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionChanged(MoneroRpcConnection connection) {
|
public void onConnectionChanged(MoneroRpcConnection connection) {
|
||||||
maybeInitializeKeyImagePoller();
|
maybeInitializeKeyImagePoller();
|
||||||
keyImagePoller.setDaemon(connectionsService.getDaemon());
|
keyImagePoller.setDaemon(xmrConnectionService.getDaemon());
|
||||||
keyImagePoller.setRefreshPeriodMs(getKeyImageRefreshPeriodMs());
|
keyImagePoller.setRefreshPeriodMs(getKeyImageRefreshPeriodMs());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -268,10 +268,10 @@ public class OfferBookService {
|
||||||
|
|
||||||
private synchronized void maybeInitializeKeyImagePoller() {
|
private synchronized void maybeInitializeKeyImagePoller() {
|
||||||
if (keyImagePoller != null) return;
|
if (keyImagePoller != null) return;
|
||||||
keyImagePoller = new MoneroKeyImagePoller(connectionsService.getDaemon(), getKeyImageRefreshPeriodMs());
|
keyImagePoller = new XmrKeyImagePoller(xmrConnectionService.getDaemon(), getKeyImageRefreshPeriodMs());
|
||||||
|
|
||||||
// handle when key images spent
|
// handle when key images spent
|
||||||
keyImagePoller.addListener(new MoneroKeyImageListener() {
|
keyImagePoller.addListener(new XmrKeyImageListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSpentStatusChanged(Map<String, MoneroKeyImageSpentStatus> spentStatuses) {
|
public void onSpentStatusChanged(Map<String, MoneroKeyImageSpentStatus> spentStatuses) {
|
||||||
for (String keyImage : spentStatuses.keySet()) {
|
for (String keyImage : spentStatuses.keySet()) {
|
||||||
|
@ -289,7 +289,7 @@ public class OfferBookService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getKeyImageRefreshPeriodMs() {
|
private long getKeyImageRefreshPeriodMs() {
|
||||||
return connectionsService.isConnectionLocal() ? KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL : KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE;
|
return xmrConnectionService.isConnectionLocal() ? KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL : KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAffectedOffers(String keyImage) {
|
private void updateAffectedOffers(String keyImage) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ import haveno.common.proto.persistable.PersistedDataHost;
|
||||||
import haveno.common.util.Tuple2;
|
import haveno.common.util.Tuple2;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.api.CoreContext;
|
import haveno.core.api.CoreContext;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.exceptions.TradePriceOutOfToleranceException;
|
import haveno.core.exceptions.TradePriceOutOfToleranceException;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.offer.OfferBookService.OfferBookChangedListener;
|
import haveno.core.offer.OfferBookService.OfferBookChangedListener;
|
||||||
|
@ -58,8 +58,8 @@ import haveno.core.util.JsonUtil;
|
||||||
import haveno.core.util.Validator;
|
import haveno.core.util.Validator;
|
||||||
import haveno.core.xmr.model.XmrAddressEntry;
|
import haveno.core.xmr.model.XmrAddressEntry;
|
||||||
import haveno.core.xmr.wallet.BtcWalletService;
|
import haveno.core.xmr.wallet.BtcWalletService;
|
||||||
import haveno.core.xmr.wallet.MoneroKeyImageListener;
|
import haveno.core.xmr.wallet.XmrKeyImageListener;
|
||||||
import haveno.core.xmr.wallet.MoneroKeyImagePoller;
|
import haveno.core.xmr.wallet.XmrKeyImagePoller;
|
||||||
import haveno.core.xmr.wallet.TradeWalletService;
|
import haveno.core.xmr.wallet.TradeWalletService;
|
||||||
import haveno.core.xmr.wallet.XmrWalletService;
|
import haveno.core.xmr.wallet.XmrWalletService;
|
||||||
import haveno.network.p2p.AckMessage;
|
import haveno.network.p2p.AckMessage;
|
||||||
|
@ -121,7 +121,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
private final User user;
|
private final User user;
|
||||||
private final P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
@Getter
|
@Getter
|
||||||
private final CoreMoneroConnectionsService connectionsService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
private final BtcWalletService btcWalletService;
|
private final BtcWalletService btcWalletService;
|
||||||
@Getter
|
@Getter
|
||||||
private final XmrWalletService xmrWalletService;
|
private final XmrWalletService xmrWalletService;
|
||||||
|
@ -150,7 +150,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
private final AccountAgeWitnessService accountAgeWitnessService;
|
private final AccountAgeWitnessService accountAgeWitnessService;
|
||||||
|
|
||||||
// poll key images of signed offers
|
// poll key images of signed offers
|
||||||
private MoneroKeyImagePoller signedOfferKeyImagePoller;
|
private XmrKeyImagePoller signedOfferKeyImagePoller;
|
||||||
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL = 20000; // 20 seconds
|
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL = 20000; // 20 seconds
|
||||||
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE = 300000; // 5 minutes
|
private static final long KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE = 300000; // 5 minutes
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
KeyRing keyRing,
|
KeyRing keyRing,
|
||||||
User user,
|
User user,
|
||||||
P2PService p2PService,
|
P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionsService,
|
XmrConnectionService xmrConnectionService,
|
||||||
BtcWalletService btcWalletService,
|
BtcWalletService btcWalletService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
TradeWalletService tradeWalletService,
|
TradeWalletService tradeWalletService,
|
||||||
|
@ -186,7 +186,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
this.keyRing = keyRing;
|
this.keyRing = keyRing;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.p2PService = p2PService;
|
this.p2PService = p2PService;
|
||||||
this.connectionsService = connectionsService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.btcWalletService = btcWalletService;
|
this.btcWalletService = btcWalletService;
|
||||||
this.xmrWalletService = xmrWalletService;
|
this.xmrWalletService = xmrWalletService;
|
||||||
this.tradeWalletService = tradeWalletService;
|
this.tradeWalletService = tradeWalletService;
|
||||||
|
@ -207,7 +207,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
this.signedOfferPersistenceManager.initialize(signedOffers, "SignedOffers", PersistenceManager.Source.PRIVATE); // arbitrator stores reserve tx for signed offers
|
this.signedOfferPersistenceManager.initialize(signedOffers, "SignedOffers", PersistenceManager.Source.PRIVATE); // arbitrator stores reserve tx for signed offers
|
||||||
|
|
||||||
// listen for connection changes to monerod
|
// listen for connection changes to monerod
|
||||||
connectionsService.addConnectionListener(new MoneroConnectionManagerListener() {
|
xmrConnectionService.addConnectionListener(new MoneroConnectionManagerListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionChanged(MoneroRpcConnection connection) {
|
public void onConnectionChanged(MoneroRpcConnection connection) {
|
||||||
maybeInitializeKeyImagePoller();
|
maybeInitializeKeyImagePoller();
|
||||||
|
@ -250,10 +250,10 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
|
|
||||||
private synchronized void maybeInitializeKeyImagePoller() {
|
private synchronized void maybeInitializeKeyImagePoller() {
|
||||||
if (signedOfferKeyImagePoller != null) return;
|
if (signedOfferKeyImagePoller != null) return;
|
||||||
signedOfferKeyImagePoller = new MoneroKeyImagePoller(connectionsService.getDaemon(), getKeyImageRefreshPeriodMs());
|
signedOfferKeyImagePoller = new XmrKeyImagePoller(xmrConnectionService.getDaemon(), getKeyImageRefreshPeriodMs());
|
||||||
|
|
||||||
// handle when key images confirmed spent
|
// handle when key images confirmed spent
|
||||||
signedOfferKeyImagePoller.addListener(new MoneroKeyImageListener() {
|
signedOfferKeyImagePoller.addListener(new XmrKeyImageListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSpentStatusChanged(Map<String, MoneroKeyImageSpentStatus> spentStatuses) {
|
public void onSpentStatusChanged(Map<String, MoneroKeyImageSpentStatus> spentStatuses) {
|
||||||
for (Entry<String, MoneroKeyImageSpentStatus> entry : spentStatuses.entrySet()) {
|
for (Entry<String, MoneroKeyImageSpentStatus> entry : spentStatuses.entrySet()) {
|
||||||
|
@ -273,7 +273,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getKeyImageRefreshPeriodMs() {
|
private long getKeyImageRefreshPeriodMs() {
|
||||||
return connectionsService.isConnectionLocal() ? KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL : KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE;
|
return xmrConnectionService.isConnectionLocal() ? KEY_IMAGE_REFRESH_PERIOD_MS_LOCAL : KEY_IMAGE_REFRESH_PERIOD_MS_REMOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAllServicesInitialized() {
|
public void onAllServicesInitialized() {
|
||||||
|
@ -1284,7 +1284,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't allow trade start if Monero node is not fully synced
|
// Don't allow trade start if Monero node is not fully synced
|
||||||
if (!connectionsService.isSyncedWithinTolerance()) {
|
if (!xmrConnectionService.isSyncedWithinTolerance()) {
|
||||||
errorMessage = "We got a handleOfferAvailabilityRequest but our chain is not synced.";
|
errorMessage = "We got a handleOfferAvailabilityRequest but our chain is not synced.";
|
||||||
log.info(errorMessage);
|
log.info(errorMessage);
|
||||||
sendAckMessage(request.getClass(), peer, request.getPubKeyRing(), request.getOfferId(), request.getUid(), false, errorMessage);
|
sendAckMessage(request.getClass(), peer, request.getPubKeyRing(), request.getOfferId(), request.getUid(), false, errorMessage);
|
||||||
|
|
|
@ -21,7 +21,7 @@ import haveno.common.Timer;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.common.crypto.PubKeyRing;
|
import haveno.common.crypto.PubKeyRing;
|
||||||
import haveno.common.proto.network.NetworkEnvelope;
|
import haveno.common.proto.network.NetworkEnvelope;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.support.dispute.Dispute;
|
import haveno.core.support.dispute.Dispute;
|
||||||
|
@ -53,7 +53,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
public abstract class SupportManager {
|
public abstract class SupportManager {
|
||||||
protected final P2PService p2PService;
|
protected final P2PService p2PService;
|
||||||
protected final TradeManager tradeManager;
|
protected final TradeManager tradeManager;
|
||||||
protected final CoreMoneroConnectionsService connectionService;
|
protected final XmrConnectionService xmrConnectionService;
|
||||||
protected final XmrWalletService xmrWalletService;
|
protected final XmrWalletService xmrWalletService;
|
||||||
protected final CoreNotificationService notificationService;
|
protected final CoreNotificationService notificationService;
|
||||||
protected final Map<String, Timer> delayMsgMap = new HashMap<>();
|
protected final Map<String, Timer> delayMsgMap = new HashMap<>();
|
||||||
|
@ -69,12 +69,12 @@ public abstract class SupportManager {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public SupportManager(P2PService p2PService,
|
public SupportManager(P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
TradeManager tradeManager) {
|
TradeManager tradeManager) {
|
||||||
this.p2PService = p2PService;
|
this.p2PService = p2PService;
|
||||||
this.connectionService = connectionService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.xmrWalletService = xmrWalletService;
|
this.xmrWalletService = xmrWalletService;
|
||||||
this.mailboxMessageService = p2PService.getMailboxMessageService();
|
this.mailboxMessageService = p2PService.getMailboxMessageService();
|
||||||
this.notificationService = notificationService;
|
this.notificationService = notificationService;
|
||||||
|
@ -336,8 +336,8 @@ public abstract class SupportManager {
|
||||||
private boolean isReady() {
|
private boolean isReady() {
|
||||||
return allServicesInitialized &&
|
return allServicesInitialized &&
|
||||||
p2PService.isBootstrapped() &&
|
p2PService.isBootstrapped() &&
|
||||||
connectionService.isDownloadComplete() &&
|
xmrConnectionService.isDownloadComplete() &&
|
||||||
connectionService.hasSufficientPeersForBroadcast() &&
|
xmrConnectionService.hasSufficientPeersForBroadcast() &&
|
||||||
xmrWalletService.isWalletSynced();
|
xmrWalletService.isWalletSynced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import haveno.common.handlers.FaultHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.common.util.MathUtils;
|
import haveno.common.util.MathUtils;
|
||||||
import haveno.common.util.Tuple2;
|
import haveno.common.util.Tuple2;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
|
@ -105,7 +105,7 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
||||||
public DisputeManager(P2PService p2PService,
|
public DisputeManager(P2PService p2PService,
|
||||||
TradeWalletService tradeWalletService,
|
TradeWalletService tradeWalletService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
ClosedTradableManager closedTradableManager,
|
ClosedTradableManager closedTradableManager,
|
||||||
|
@ -114,7 +114,7 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
||||||
DisputeListService<T> disputeListService,
|
DisputeListService<T> disputeListService,
|
||||||
Config config,
|
Config config,
|
||||||
PriceFeedService priceFeedService) {
|
PriceFeedService priceFeedService) {
|
||||||
super(p2PService, connectionService, xmrWalletService, notificationService, tradeManager);
|
super(p2PService, xmrConnectionService, xmrWalletService, notificationService, tradeManager);
|
||||||
|
|
||||||
this.tradeWalletService = tradeWalletService;
|
this.tradeWalletService = tradeWalletService;
|
||||||
this.xmrWalletService = xmrWalletService;
|
this.xmrWalletService = xmrWalletService;
|
||||||
|
@ -252,8 +252,8 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connectionService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
|
xmrConnectionService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
if (connectionService.isDownloadComplete())
|
if (xmrConnectionService.isDownloadComplete())
|
||||||
tryApplyMessages();
|
tryApplyMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -262,8 +262,8 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
|
||||||
tryApplyMessages();
|
tryApplyMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
connectionService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
|
xmrConnectionService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
if (connectionService.hasSufficientPeersForBroadcast())
|
if (xmrConnectionService.hasSufficientPeersForBroadcast())
|
||||||
tryApplyMessages();
|
tryApplyMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import haveno.common.UserThread;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.OpenOfferManager;
|
import haveno.core.offer.OpenOfferManager;
|
||||||
|
@ -84,7 +84,7 @@ public final class ArbitrationManager extends DisputeManager<ArbitrationDisputeL
|
||||||
public ArbitrationManager(P2PService p2PService,
|
public ArbitrationManager(P2PService p2PService,
|
||||||
TradeWalletService tradeWalletService,
|
TradeWalletService tradeWalletService,
|
||||||
XmrWalletService walletService,
|
XmrWalletService walletService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
ArbitratorManager arbitratorManager,
|
ArbitratorManager arbitratorManager,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
|
@ -94,7 +94,7 @@ public final class ArbitrationManager extends DisputeManager<ArbitrationDisputeL
|
||||||
ArbitrationDisputeListService arbitrationDisputeListService,
|
ArbitrationDisputeListService arbitrationDisputeListService,
|
||||||
Config config,
|
Config config,
|
||||||
PriceFeedService priceFeedService) {
|
PriceFeedService priceFeedService) {
|
||||||
super(p2PService, tradeWalletService, walletService, connectionService, notificationService, tradeManager, closedTradableManager,
|
super(p2PService, tradeWalletService, walletService, xmrConnectionService, notificationService, tradeManager, closedTradableManager,
|
||||||
openOfferManager, keyRing, arbitrationDisputeListService, config, priceFeedService);
|
openOfferManager, keyRing, arbitrationDisputeListService, config, priceFeedService);
|
||||||
this.arbitratorManager = arbitratorManager;
|
this.arbitratorManager = arbitratorManager;
|
||||||
HavenoUtils.arbitrationManager = this; // TODO: storing static reference, better way?
|
HavenoUtils.arbitrationManager = this; // TODO: storing static reference, better way?
|
||||||
|
|
|
@ -26,7 +26,7 @@ import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.common.handlers.ErrorMessageHandler;
|
import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.OpenOffer;
|
import haveno.core.offer.OpenOffer;
|
||||||
|
@ -71,7 +71,7 @@ public final class MediationManager extends DisputeManager<MediationDisputeList>
|
||||||
public MediationManager(P2PService p2PService,
|
public MediationManager(P2PService p2PService,
|
||||||
TradeWalletService tradeWalletService,
|
TradeWalletService tradeWalletService,
|
||||||
XmrWalletService walletService,
|
XmrWalletService walletService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
ClosedTradableManager closedTradableManager,
|
ClosedTradableManager closedTradableManager,
|
||||||
|
@ -80,7 +80,7 @@ public final class MediationManager extends DisputeManager<MediationDisputeList>
|
||||||
MediationDisputeListService mediationDisputeListService,
|
MediationDisputeListService mediationDisputeListService,
|
||||||
Config config,
|
Config config,
|
||||||
PriceFeedService priceFeedService) {
|
PriceFeedService priceFeedService) {
|
||||||
super(p2PService, tradeWalletService, walletService, connectionService, notificationService, tradeManager, closedTradableManager,
|
super(p2PService, tradeWalletService, walletService, xmrConnectionService, notificationService, tradeManager, closedTradableManager,
|
||||||
openOfferManager, keyRing, mediationDisputeListService, config, priceFeedService);
|
openOfferManager, keyRing, mediationDisputeListService, config, priceFeedService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import haveno.common.UserThread;
|
||||||
import haveno.common.app.Version;
|
import haveno.common.app.Version;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.crypto.KeyRing;
|
import haveno.common.crypto.KeyRing;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.OpenOffer;
|
import haveno.core.offer.OpenOffer;
|
||||||
|
@ -66,7 +66,7 @@ public final class RefundManager extends DisputeManager<RefundDisputeList> {
|
||||||
public RefundManager(P2PService p2PService,
|
public RefundManager(P2PService p2PService,
|
||||||
TradeWalletService tradeWalletService,
|
TradeWalletService tradeWalletService,
|
||||||
XmrWalletService walletService,
|
XmrWalletService walletService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
ClosedTradableManager closedTradableManager,
|
ClosedTradableManager closedTradableManager,
|
||||||
|
@ -76,7 +76,7 @@ public final class RefundManager extends DisputeManager<RefundDisputeList> {
|
||||||
RefundDisputeListService refundDisputeListService,
|
RefundDisputeListService refundDisputeListService,
|
||||||
Config config,
|
Config config,
|
||||||
PriceFeedService priceFeedService) {
|
PriceFeedService priceFeedService) {
|
||||||
super(p2PService, tradeWalletService, walletService, connectionService, notificationService, tradeManager, closedTradableManager,
|
super(p2PService, tradeWalletService, walletService, xmrConnectionService, notificationService, tradeManager, closedTradableManager,
|
||||||
openOfferManager, keyRing, refundDisputeListService, config, priceFeedService);
|
openOfferManager, keyRing, refundDisputeListService, config, priceFeedService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package haveno.core.support.traderchat;
|
||||||
|
|
||||||
import haveno.common.crypto.PubKeyRing;
|
import haveno.common.crypto.PubKeyRing;
|
||||||
import haveno.common.crypto.PubKeyRingProvider;
|
import haveno.common.crypto.PubKeyRingProvider;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.CoreNotificationService;
|
import haveno.core.api.CoreNotificationService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.support.SupportManager;
|
import haveno.core.support.SupportManager;
|
||||||
|
@ -53,12 +53,12 @@ public class TraderChatManager extends SupportManager {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TraderChatManager(P2PService p2PService,
|
public TraderChatManager(P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
CoreNotificationService notificationService,
|
CoreNotificationService notificationService,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
PubKeyRingProvider pubKeyRingProvider) {
|
PubKeyRingProvider pubKeyRingProvider) {
|
||||||
super(p2PService, connectionService, xmrWalletService, notificationService, tradeManager);
|
super(p2PService, xmrConnectionService, xmrWalletService, notificationService, tradeManager);
|
||||||
this.pubKeyRingProvider = pubKeyRingProvider;
|
this.pubKeyRingProvider = pubKeyRingProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import haveno.common.crypto.PubKeyRing;
|
||||||
import haveno.common.proto.ProtoUtil;
|
import haveno.common.proto.ProtoUtil;
|
||||||
import haveno.common.taskrunner.Model;
|
import haveno.common.taskrunner.Model;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.monetary.Price;
|
import haveno.core.monetary.Price;
|
||||||
import haveno.core.monetary.Volume;
|
import haveno.core.monetary.Volume;
|
||||||
import haveno.core.offer.Offer;
|
import haveno.core.offer.Offer;
|
||||||
|
@ -758,9 +758,9 @@ public abstract class Trade implements Tradable, Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkDaemonConnection() {
|
public void checkDaemonConnection() {
|
||||||
CoreMoneroConnectionsService connectionService = xmrWalletService.getConnectionsService();
|
XmrConnectionService xmrConnectionService = xmrWalletService.getConnectionsService();
|
||||||
connectionService.checkConnection();
|
xmrConnectionService.checkConnection();
|
||||||
connectionService.verifyConnection();
|
xmrConnectionService.verifyConnection();
|
||||||
if (!getWallet().isConnectedToDaemon()) throw new RuntimeException("Trade wallet is not connected to a Monero node");
|
if (!getWallet().isConnectedToDaemon()) throw new RuntimeException("Trade wallet is not connected to a Monero node");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import haveno.core.locale.GlobalSettings;
|
||||||
import haveno.core.locale.TradeCurrency;
|
import haveno.core.locale.TradeCurrency;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.payment.PaymentAccountUtil;
|
import haveno.core.payment.PaymentAccountUtil;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.XmrNodeSettings;
|
||||||
import haveno.core.xmr.nodes.XmrNodes;
|
import haveno.core.xmr.nodes.XmrNodes;
|
||||||
import haveno.core.xmr.wallet.Restrictions;
|
import haveno.core.xmr.wallet.Restrictions;
|
||||||
import haveno.network.p2p.network.BridgeAddressProvider;
|
import haveno.network.p2p.network.BridgeAddressProvider;
|
||||||
|
@ -724,8 +724,8 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||||
requestPersistence();
|
requestPersistence();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMoneroNodeSettings(MoneroNodeSettings settings) {
|
public void setXmrNodeSettings(XmrNodeSettings settings) {
|
||||||
prefPayload.setMoneroNodeSettings(settings);
|
prefPayload.setXmrNodeSettings(settings);
|
||||||
requestPersistence();
|
requestPersistence();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -977,6 +977,6 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||||
|
|
||||||
void setNotifyOnPreRelease(boolean value);
|
void setNotifyOnPreRelease(boolean value);
|
||||||
|
|
||||||
void setMoneroNodeSettings(MoneroNodeSettings settings);
|
void setXmrNodeSettings(XmrNodeSettings settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import haveno.core.locale.TraditionalCurrency;
|
||||||
import haveno.core.locale.TradeCurrency;
|
import haveno.core.locale.TradeCurrency;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.proto.CoreProtoResolver;
|
import haveno.core.proto.CoreProtoResolver;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.XmrNodeSettings;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -131,7 +131,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
|
||||||
private boolean denyApiTaker;
|
private boolean denyApiTaker;
|
||||||
private boolean notifyOnPreRelease;
|
private boolean notifyOnPreRelease;
|
||||||
|
|
||||||
private MoneroNodeSettings moneroNodeSettings = new MoneroNodeSettings();
|
private XmrNodeSettings xmrNodeSettings = new XmrNodeSettings();
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -217,7 +217,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
|
||||||
Optional.ofNullable(rpcUser).ifPresent(builder::setRpcUser);
|
Optional.ofNullable(rpcUser).ifPresent(builder::setRpcUser);
|
||||||
Optional.ofNullable(rpcPw).ifPresent(builder::setRpcPw);
|
Optional.ofNullable(rpcPw).ifPresent(builder::setRpcPw);
|
||||||
Optional.ofNullable(takeOfferSelectedPaymentAccountId).ifPresent(builder::setTakeOfferSelectedPaymentAccountId);
|
Optional.ofNullable(takeOfferSelectedPaymentAccountId).ifPresent(builder::setTakeOfferSelectedPaymentAccountId);
|
||||||
Optional.ofNullable(moneroNodeSettings).ifPresent(settings -> builder.setMoneroNodeSettings(settings.toProtoMessage()));
|
Optional.ofNullable(xmrNodeSettings).ifPresent(settings -> builder.setXmrNodeSettings(settings.toProtoMessage()));
|
||||||
return protobuf.PersistableEnvelope.newBuilder().setPreferencesPayload(builder).build();
|
return protobuf.PersistableEnvelope.newBuilder().setPreferencesPayload(builder).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
|
||||||
proto.getShowOffersMatchingMyAccounts(),
|
proto.getShowOffersMatchingMyAccounts(),
|
||||||
proto.getDenyApiTaker(),
|
proto.getDenyApiTaker(),
|
||||||
proto.getNotifyOnPreRelease(),
|
proto.getNotifyOnPreRelease(),
|
||||||
MoneroNodeSettings.fromProto(proto.getMoneroNodeSettings())
|
XmrNodeSettings.fromProto(proto.getXmrNodeSettings())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,20 @@ package haveno.core.xmr;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import haveno.common.app.AppModule;
|
import haveno.common.app.AppModule;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.xmr.model.EncryptedConnectionList;
|
import haveno.core.xmr.model.EncryptedConnectionList;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MoneroConnectionModule extends AppModule {
|
public class XmrConnectionModule extends AppModule {
|
||||||
|
|
||||||
public MoneroConnectionModule(Config config) {
|
public XmrConnectionModule(Config config) {
|
||||||
super(config);
|
super(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected final void configure() {
|
protected final void configure() {
|
||||||
bind(EncryptedConnectionList.class).in(Singleton.class);
|
bind(EncryptedConnectionList.class).in(Singleton.class);
|
||||||
bind(CoreMoneroConnectionsService.class).in(Singleton.class);
|
bind(XmrConnectionService.class).in(Singleton.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -44,9 +44,9 @@ import static haveno.common.config.Config.PROVIDERS;
|
||||||
import static haveno.common.config.Config.WALLET_DIR;
|
import static haveno.common.config.Config.WALLET_DIR;
|
||||||
import static haveno.common.config.Config.WALLET_RPC_BIND_PORT;
|
import static haveno.common.config.Config.WALLET_RPC_BIND_PORT;
|
||||||
|
|
||||||
public class MoneroModule extends AppModule {
|
public class XmrModule extends AppModule {
|
||||||
|
|
||||||
public MoneroModule(Config config) {
|
public XmrModule(Config config) {
|
||||||
super(config);
|
super(config);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import javax.annotation.Nullable;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MoneroNodeSettings implements PersistableEnvelope {
|
public class XmrNodeSettings implements PersistableEnvelope {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
String blockchainPath;
|
String blockchainPath;
|
||||||
|
@ -36,19 +36,19 @@ public class MoneroNodeSettings implements PersistableEnvelope {
|
||||||
@Nullable
|
@Nullable
|
||||||
List<String> startupFlags;
|
List<String> startupFlags;
|
||||||
|
|
||||||
public MoneroNodeSettings() {
|
public XmrNodeSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MoneroNodeSettings fromProto(protobuf.MoneroNodeSettings proto) {
|
public static XmrNodeSettings fromProto(protobuf.XmrNodeSettings proto) {
|
||||||
return new MoneroNodeSettings(
|
return new XmrNodeSettings(
|
||||||
proto.getBlockchainPath(),
|
proto.getBlockchainPath(),
|
||||||
proto.getBootstrapUrl(),
|
proto.getBootstrapUrl(),
|
||||||
proto.getStartupFlagsList());
|
proto.getStartupFlagsList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public protobuf.MoneroNodeSettings toProtoMessage() {
|
public protobuf.XmrNodeSettings toProtoMessage() {
|
||||||
protobuf.MoneroNodeSettings.Builder builder = protobuf.MoneroNodeSettings.newBuilder();
|
protobuf.XmrNodeSettings.Builder builder = protobuf.XmrNodeSettings.newBuilder();
|
||||||
Optional.ofNullable(blockchainPath).ifPresent(e -> builder.setBlockchainPath(blockchainPath));
|
Optional.ofNullable(blockchainPath).ifPresent(e -> builder.setBlockchainPath(blockchainPath));
|
||||||
Optional.ofNullable(bootstrapUrl).ifPresent(e -> builder.setBlockchainPath(bootstrapUrl));
|
Optional.ofNullable(bootstrapUrl).ifPresent(e -> builder.setBlockchainPath(bootstrapUrl));
|
||||||
Optional.ofNullable(startupFlags).ifPresent(e -> builder.addAllStartupFlags(startupFlags));
|
Optional.ofNullable(startupFlags).ifPresent(e -> builder.addAllStartupFlags(startupFlags));
|
|
@ -22,7 +22,7 @@ import com.google.common.util.concurrent.AbstractIdleService;
|
||||||
import com.runjva.sourceforge.jsocks.protocol.Socks5Proxy;
|
import com.runjva.sourceforge.jsocks.protocol.Socks5Proxy;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.file.FileUtil;
|
import haveno.common.file.FileUtil;
|
||||||
import haveno.core.api.LocalMoneroNode;
|
import haveno.core.api.XmrLocalNode;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
@ -101,7 +101,7 @@ public class WalletConfig extends AbstractIdleService {
|
||||||
protected volatile Context context;
|
protected volatile Context context;
|
||||||
|
|
||||||
protected Config config;
|
protected Config config;
|
||||||
protected LocalMoneroNode localMoneroNode;
|
protected XmrLocalNode xmrLocalNode;
|
||||||
protected Socks5Proxy socks5Proxy;
|
protected Socks5Proxy socks5Proxy;
|
||||||
protected int numConnectionsForBtc;
|
protected int numConnectionsForBtc;
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -141,9 +141,9 @@ public class WalletConfig extends AbstractIdleService {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WalletConfig setLocalMoneroNodeService(LocalMoneroNode localMoneroNode) {
|
public WalletConfig setXmrLocalNode(XmrLocalNode xmrLocalNode) {
|
||||||
checkState(state() == State.NEW, "Cannot call after startup");
|
checkState(state() == State.NEW, "Cannot call after startup");
|
||||||
this.localMoneroNode = localMoneroNode;
|
this.xmrLocalNode = xmrLocalNode;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import haveno.common.config.Config;
|
||||||
import haveno.common.file.FileUtil;
|
import haveno.common.file.FileUtil;
|
||||||
import haveno.common.handlers.ExceptionHandler;
|
import haveno.common.handlers.ExceptionHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.core.api.LocalMoneroNode;
|
import haveno.core.api.XmrLocalNode;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
import haveno.core.xmr.exceptions.InvalidHostException;
|
import haveno.core.xmr.exceptions.InvalidHostException;
|
||||||
import haveno.core.xmr.model.AddressEntry;
|
import haveno.core.xmr.model.AddressEntry;
|
||||||
|
@ -94,7 +94,7 @@ public class WalletsSetup {
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final Socks5ProxyProvider socks5ProxyProvider;
|
private final Socks5ProxyProvider socks5ProxyProvider;
|
||||||
private final Config config;
|
private final Config config;
|
||||||
private final LocalMoneroNode localMoneroNode;
|
private final XmrLocalNode xmrLocalNode;
|
||||||
private final XmrNodes xmrNodes;
|
private final XmrNodes xmrNodes;
|
||||||
private final int numConnectionsForBtc;
|
private final int numConnectionsForBtc;
|
||||||
private final String userAgent;
|
private final String userAgent;
|
||||||
|
@ -117,7 +117,7 @@ public class WalletsSetup {
|
||||||
Preferences preferences,
|
Preferences preferences,
|
||||||
Socks5ProxyProvider socks5ProxyProvider,
|
Socks5ProxyProvider socks5ProxyProvider,
|
||||||
Config config,
|
Config config,
|
||||||
LocalMoneroNode localMoneroNode,
|
XmrLocalNode xmrLocalNode,
|
||||||
XmrNodes xmrNodes,
|
XmrNodes xmrNodes,
|
||||||
@Named(Config.USER_AGENT) String userAgent,
|
@Named(Config.USER_AGENT) String userAgent,
|
||||||
@Named(Config.WALLET_DIR) File walletDir,
|
@Named(Config.WALLET_DIR) File walletDir,
|
||||||
|
@ -129,7 +129,7 @@ public class WalletsSetup {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
this.socks5ProxyProvider = socks5ProxyProvider;
|
this.socks5ProxyProvider = socks5ProxyProvider;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.localMoneroNode = localMoneroNode;
|
this.xmrLocalNode = xmrLocalNode;
|
||||||
this.xmrNodes = xmrNodes;
|
this.xmrNodes = xmrNodes;
|
||||||
this.numConnectionsForBtc = numConnectionsForBtc;
|
this.numConnectionsForBtc = numConnectionsForBtc;
|
||||||
this.useAllProvidedNodes = useAllProvidedNodes;
|
this.useAllProvidedNodes = useAllProvidedNodes;
|
||||||
|
@ -186,7 +186,7 @@ public class WalletsSetup {
|
||||||
};
|
};
|
||||||
walletConfig.setSocks5Proxy(socks5Proxy);
|
walletConfig.setSocks5Proxy(socks5Proxy);
|
||||||
walletConfig.setConfig(config);
|
walletConfig.setConfig(config);
|
||||||
walletConfig.setLocalMoneroNodeService(localMoneroNode); // TODO: adapt to xmr or remove
|
walletConfig.setXmrLocalNode(xmrLocalNode); // TODO: adapt to xmr or remove
|
||||||
walletConfig.setUserAgent(userAgent, Version.VERSION);
|
walletConfig.setUserAgent(userAgent, Version.VERSION);
|
||||||
walletConfig.setNumConnectionsForBtc(numConnectionsForBtc);
|
walletConfig.setNumConnectionsForBtc(numConnectionsForBtc);
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ public class WalletsSetup {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (localMoneroNode.shouldBeUsed()) {
|
} else if (xmrLocalNode.shouldBeUsed()) {
|
||||||
walletConfig.setMinBroadcastConnections(1);
|
walletConfig.setMinBroadcastConnections(1);
|
||||||
walletConfig.connectToLocalHost();
|
walletConfig.connectToLocalHost();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import monero.daemon.model.MoneroKeyImageSpentStatus;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public interface MoneroKeyImageListener {
|
public interface XmrKeyImageListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called with changes to the spent status of key images.
|
* Called with changes to the spent status of key images.
|
|
@ -21,12 +21,12 @@ import java.util.Set;
|
||||||
* TODO: move to monero-java?
|
* TODO: move to monero-java?
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MoneroKeyImagePoller {
|
public class XmrKeyImagePoller {
|
||||||
|
|
||||||
private MoneroDaemon daemon;
|
private MoneroDaemon daemon;
|
||||||
private long refreshPeriodMs;
|
private long refreshPeriodMs;
|
||||||
private List<String> keyImages = new ArrayList<String>();
|
private List<String> keyImages = new ArrayList<String>();
|
||||||
private Set<MoneroKeyImageListener> listeners = new HashSet<MoneroKeyImageListener>();
|
private Set<XmrKeyImageListener> listeners = new HashSet<XmrKeyImageListener>();
|
||||||
private TaskLooper looper;
|
private TaskLooper looper;
|
||||||
private Map<String, MoneroKeyImageSpentStatus> lastStatuses = new HashMap<String, MoneroKeyImageSpentStatus>();
|
private Map<String, MoneroKeyImageSpentStatus> lastStatuses = new HashMap<String, MoneroKeyImageSpentStatus>();
|
||||||
private boolean isPolling = false;
|
private boolean isPolling = false;
|
||||||
|
@ -37,7 +37,7 @@ public class MoneroKeyImagePoller {
|
||||||
* @param refreshPeriodMs - refresh period in milliseconds
|
* @param refreshPeriodMs - refresh period in milliseconds
|
||||||
* @param keyImages - key images to listen to
|
* @param keyImages - key images to listen to
|
||||||
*/
|
*/
|
||||||
public MoneroKeyImagePoller() {
|
public XmrKeyImagePoller() {
|
||||||
looper = new TaskLooper(() -> poll());
|
looper = new TaskLooper(() -> poll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class MoneroKeyImagePoller {
|
||||||
* @param refreshPeriodMs - refresh period in milliseconds
|
* @param refreshPeriodMs - refresh period in milliseconds
|
||||||
* @param keyImages - key images to listen to
|
* @param keyImages - key images to listen to
|
||||||
*/
|
*/
|
||||||
public MoneroKeyImagePoller(MoneroDaemon daemon, long refreshPeriodMs, String... keyImages) {
|
public XmrKeyImagePoller(MoneroDaemon daemon, long refreshPeriodMs, String... keyImages) {
|
||||||
looper = new TaskLooper(() -> poll());
|
looper = new TaskLooper(() -> poll());
|
||||||
setDaemon(daemon);
|
setDaemon(daemon);
|
||||||
setRefreshPeriodMs(refreshPeriodMs);
|
setRefreshPeriodMs(refreshPeriodMs);
|
||||||
|
@ -59,7 +59,7 @@ public class MoneroKeyImagePoller {
|
||||||
*
|
*
|
||||||
* @param listener - the listener to add
|
* @param listener - the listener to add
|
||||||
*/
|
*/
|
||||||
public void addListener(MoneroKeyImageListener listener) {
|
public void addListener(XmrKeyImageListener listener) {
|
||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
refreshPolling();
|
refreshPolling();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class MoneroKeyImagePoller {
|
||||||
*
|
*
|
||||||
* @param listener - the listener to remove
|
* @param listener - the listener to remove
|
||||||
*/
|
*/
|
||||||
public void removeListener(MoneroKeyImageListener listener) {
|
public void removeListener(XmrKeyImageListener listener) {
|
||||||
if (!listeners.contains(listener)) throw new MoneroError("Listener is not registered");
|
if (!listeners.contains(listener)) throw new MoneroError("Listener is not registered");
|
||||||
listeners.remove(listener);
|
listeners.remove(listener);
|
||||||
refreshPolling();
|
refreshPolling();
|
||||||
|
@ -265,7 +265,7 @@ public class MoneroKeyImagePoller {
|
||||||
|
|
||||||
// announce changes
|
// announce changes
|
||||||
if (!changedStatuses.isEmpty()) {
|
if (!changedStatuses.isEmpty()) {
|
||||||
for (MoneroKeyImageListener listener : new ArrayList<MoneroKeyImageListener>(listeners)) {
|
for (XmrKeyImageListener listener : new ArrayList<XmrKeyImageListener>(listeners)) {
|
||||||
listener.onSpentStatusChanged(changedStatuses);
|
listener.onSpentStatusChanged(changedStatuses);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,7 +11,7 @@ import haveno.common.util.Tuple2;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.api.AccountServiceListener;
|
import haveno.core.api.AccountServiceListener;
|
||||||
import haveno.core.api.CoreAccountService;
|
import haveno.core.api.CoreAccountService;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.trade.BuyerTrade;
|
import haveno.core.trade.BuyerTrade;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
import haveno.core.trade.MakerTrade;
|
import haveno.core.trade.MakerTrade;
|
||||||
|
@ -106,7 +106,7 @@ public class XmrWalletService {
|
||||||
|
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final CoreAccountService accountService;
|
private final CoreAccountService accountService;
|
||||||
private final CoreMoneroConnectionsService connectionsService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
private final XmrAddressEntryList xmrAddressEntryList;
|
private final XmrAddressEntryList xmrAddressEntryList;
|
||||||
private final WalletsSetup walletsSetup;
|
private final WalletsSetup walletsSetup;
|
||||||
private final DownloadListener downloadListener = new DownloadListener();
|
private final DownloadListener downloadListener = new DownloadListener();
|
||||||
|
@ -129,14 +129,14 @@ public class XmrWalletService {
|
||||||
@Inject
|
@Inject
|
||||||
XmrWalletService(Preferences preferences,
|
XmrWalletService(Preferences preferences,
|
||||||
CoreAccountService accountService,
|
CoreAccountService accountService,
|
||||||
CoreMoneroConnectionsService connectionsService,
|
XmrConnectionService xmrConnectionService,
|
||||||
WalletsSetup walletsSetup,
|
WalletsSetup walletsSetup,
|
||||||
XmrAddressEntryList xmrAddressEntryList,
|
XmrAddressEntryList xmrAddressEntryList,
|
||||||
@Named(Config.WALLET_DIR) File walletDir,
|
@Named(Config.WALLET_DIR) File walletDir,
|
||||||
@Named(Config.WALLET_RPC_BIND_PORT) int rpcBindPort) {
|
@Named(Config.WALLET_RPC_BIND_PORT) int rpcBindPort) {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
this.accountService = accountService;
|
this.accountService = accountService;
|
||||||
this.connectionsService = connectionsService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.walletsSetup = walletsSetup;
|
this.walletsSetup = walletsSetup;
|
||||||
this.xmrAddressEntryList = xmrAddressEntryList;
|
this.xmrAddressEntryList = xmrAddressEntryList;
|
||||||
this.walletDir = walletDir;
|
this.walletDir = walletDir;
|
||||||
|
@ -232,11 +232,11 @@ public class XmrWalletService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoneroDaemonRpc getDaemon() {
|
public MoneroDaemonRpc getDaemon() {
|
||||||
return connectionsService.getDaemon();
|
return xmrConnectionService.getDaemon();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CoreMoneroConnectionsService getConnectionsService() {
|
public XmrConnectionService getConnectionsService() {
|
||||||
return connectionsService;
|
return xmrConnectionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isProxyApplied(boolean wasWalletSynced) {
|
public boolean isProxyApplied(boolean wasWalletSynced) {
|
||||||
|
@ -601,7 +601,7 @@ public class XmrWalletService {
|
||||||
synchronized (txCache) {
|
synchronized (txCache) {
|
||||||
|
|
||||||
// fetch txs
|
// fetch txs
|
||||||
if (getDaemon() == null) connectionsService.verifyConnection(); // will throw
|
if (getDaemon() == null) xmrConnectionService.verifyConnection(); // will throw
|
||||||
List<MoneroTx> txs = getDaemon().getTxs(txHashes, true);
|
List<MoneroTx> txs = getDaemon().getTxs(txHashes, true);
|
||||||
|
|
||||||
// store to cache
|
// store to cache
|
||||||
|
@ -612,7 +612,7 @@ public class XmrWalletService {
|
||||||
synchronized (txCache) {
|
synchronized (txCache) {
|
||||||
for (MoneroTx tx : txs) txCache.remove(tx.getHash());
|
for (MoneroTx tx : txs) txCache.remove(tx.getHash());
|
||||||
}
|
}
|
||||||
}, connectionsService.getRefreshPeriodMs() / 1000);
|
}, xmrConnectionService.getRefreshPeriodMs() / 1000);
|
||||||
return txs;
|
return txs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -675,13 +675,13 @@ public class XmrWalletService {
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
|
|
||||||
// listen for connection changes
|
// listen for connection changes
|
||||||
connectionsService.addConnectionListener(newConnection -> onConnectionChanged(newConnection));
|
xmrConnectionService.addConnectionListener(newConnection -> onConnectionChanged(newConnection));
|
||||||
|
|
||||||
// wait for monerod to sync
|
// wait for monerod to sync
|
||||||
if (connectionsService.downloadPercentageProperty().get() != 1) {
|
if (xmrConnectionService.downloadPercentageProperty().get() != 1) {
|
||||||
CountDownLatch latch = new CountDownLatch(1);
|
CountDownLatch latch = new CountDownLatch(1);
|
||||||
connectionsService.downloadPercentageProperty().addListener((obs, oldVal, newVal) -> {
|
xmrConnectionService.downloadPercentageProperty().addListener((obs, oldVal, newVal) -> {
|
||||||
if (connectionsService.downloadPercentageProperty().get() == 1) latch.countDown();
|
if (xmrConnectionService.downloadPercentageProperty().get() == 1) latch.countDown();
|
||||||
});
|
});
|
||||||
HavenoUtils.awaitLatch(latch);
|
HavenoUtils.awaitLatch(latch);
|
||||||
}
|
}
|
||||||
|
@ -699,12 +699,12 @@ public class XmrWalletService {
|
||||||
|
|
||||||
// open or create wallet main wallet
|
// open or create wallet main wallet
|
||||||
if (wallet == null) {
|
if (wallet == null) {
|
||||||
MoneroDaemonRpc daemon = connectionsService.getDaemon();
|
MoneroDaemonRpc daemon = xmrConnectionService.getDaemon();
|
||||||
log.info("Initializing main wallet with monerod=" + (daemon == null ? "null" : daemon.getRpcConnection().getUri()));
|
log.info("Initializing main wallet with monerod=" + (daemon == null ? "null" : daemon.getRpcConnection().getUri()));
|
||||||
MoneroWalletConfig walletConfig = new MoneroWalletConfig().setPath(MONERO_WALLET_NAME).setPassword(getWalletPassword());
|
MoneroWalletConfig walletConfig = new MoneroWalletConfig().setPath(MONERO_WALLET_NAME).setPassword(getWalletPassword());
|
||||||
if (MoneroUtils.walletExists(xmrWalletFile.getPath())) {
|
if (MoneroUtils.walletExists(xmrWalletFile.getPath())) {
|
||||||
wallet = openWalletRpc(walletConfig, rpcBindPort, isProxyApplied(wasWalletSynced));
|
wallet = openWalletRpc(walletConfig, rpcBindPort, isProxyApplied(wasWalletSynced));
|
||||||
} else if (connectionsService.getConnection() != null && Boolean.TRUE.equals(connectionsService.getConnection().isConnected())) {
|
} else if (xmrConnectionService.getConnection() != null && Boolean.TRUE.equals(xmrConnectionService.getConnection().isConnected())) {
|
||||||
wallet = createWalletRpc(walletConfig, rpcBindPort);
|
wallet = createWalletRpc(walletConfig, rpcBindPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -723,12 +723,12 @@ public class XmrWalletService {
|
||||||
wallet.sync(); // blocking
|
wallet.sync(); // blocking
|
||||||
wasWalletSynced = true;
|
wasWalletSynced = true;
|
||||||
log.info("Done syncing main wallet in " + (System.currentTimeMillis() - time) + " ms");
|
log.info("Done syncing main wallet in " + (System.currentTimeMillis() - time) + " ms");
|
||||||
wallet.startSyncing(connectionsService.getRefreshPeriodMs());
|
wallet.startSyncing(xmrConnectionService.getRefreshPeriodMs());
|
||||||
wallet.getTxs(new MoneroTxQuery().setIsLocked(true)); // TODO: main wallet's balance does update on startup with 0 conf PaymentReceivedMessage until pool txs fetched?
|
wallet.getTxs(new MoneroTxQuery().setIsLocked(true)); // TODO: main wallet's balance does update on startup with 0 conf PaymentReceivedMessage until pool txs fetched?
|
||||||
if (getMoneroNetworkType() != MoneroNetworkType.MAINNET) log.info("Monero wallet balance={}, unlocked balance={}", wallet.getBalance(0), wallet.getUnlockedBalance(0));
|
if (getMoneroNetworkType() != MoneroNetworkType.MAINNET) log.info("Monero wallet balance={}, unlocked balance={}", wallet.getBalance(0), wallet.getUnlockedBalance(0));
|
||||||
|
|
||||||
// reapply connection after wallet synced
|
// reapply connection after wallet synced
|
||||||
onConnectionChanged(connectionsService.getConnection());
|
onConnectionChanged(xmrConnectionService.getConnection());
|
||||||
|
|
||||||
// signal that main wallet is synced
|
// signal that main wallet is synced
|
||||||
doneDownload();
|
doneDownload();
|
||||||
|
@ -750,12 +750,12 @@ public class XmrWalletService {
|
||||||
// reschedule to init main wallet
|
// reschedule to init main wallet
|
||||||
UserThread.runAfter(() -> {
|
UserThread.runAfter(() -> {
|
||||||
new Thread(() -> maybeInitMainWallet(true, MAX_SYNC_ATTEMPTS)).start();
|
new Thread(() -> maybeInitMainWallet(true, MAX_SYNC_ATTEMPTS)).start();
|
||||||
}, connectionsService.getRefreshPeriodMs() / 1000);
|
}, xmrConnectionService.getRefreshPeriodMs() / 1000);
|
||||||
} else {
|
} else {
|
||||||
log.warn("Trying again in {} seconds", connectionsService.getRefreshPeriodMs() / 1000);
|
log.warn("Trying again in {} seconds", xmrConnectionService.getRefreshPeriodMs() / 1000);
|
||||||
UserThread.runAfter(() -> {
|
UserThread.runAfter(() -> {
|
||||||
new Thread(() -> maybeInitMainWallet(true, numAttempts - 1)).start();
|
new Thread(() -> maybeInitMainWallet(true, numAttempts - 1)).start();
|
||||||
}, connectionsService.getRefreshPeriodMs() / 1000);
|
}, xmrConnectionService.getRefreshPeriodMs() / 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,7 @@ public class XmrWalletService {
|
||||||
private MoneroWalletRpc createWalletRpc(MoneroWalletConfig config, Integer port) {
|
private MoneroWalletRpc createWalletRpc(MoneroWalletConfig config, Integer port) {
|
||||||
|
|
||||||
// must be connected to daemon
|
// must be connected to daemon
|
||||||
MoneroRpcConnection connection = connectionsService.getConnection();
|
MoneroRpcConnection connection = xmrConnectionService.getConnection();
|
||||||
if (connection == null || !Boolean.TRUE.equals(connection.isConnected())) throw new RuntimeException("Must be connected to daemon before creating wallet");
|
if (connection == null || !Boolean.TRUE.equals(connection.isConnected())) throw new RuntimeException("Must be connected to daemon before creating wallet");
|
||||||
|
|
||||||
// create wallet
|
// create wallet
|
||||||
|
@ -809,7 +809,7 @@ public class XmrWalletService {
|
||||||
walletRpc.stopSyncing();
|
walletRpc.stopSyncing();
|
||||||
|
|
||||||
// configure connection
|
// configure connection
|
||||||
MoneroRpcConnection connection = new MoneroRpcConnection(connectionsService.getConnection());
|
MoneroRpcConnection connection = new MoneroRpcConnection(xmrConnectionService.getConnection());
|
||||||
if (!applyProxyUri) connection.setProxyUri(null);
|
if (!applyProxyUri) connection.setProxyUri(null);
|
||||||
|
|
||||||
// open wallet
|
// open wallet
|
||||||
|
@ -842,7 +842,7 @@ public class XmrWalletService {
|
||||||
cmd.add("--" + MONERO_NETWORK_TYPE.toString().toLowerCase());
|
cmd.add("--" + MONERO_NETWORK_TYPE.toString().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
MoneroRpcConnection connection = connectionsService.getConnection();
|
MoneroRpcConnection connection = xmrConnectionService.getConnection();
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
cmd.add("--daemon-address");
|
cmd.add("--daemon-address");
|
||||||
cmd.add(connection.getUri());
|
cmd.add(connection.getUri());
|
||||||
|
@ -887,7 +887,7 @@ public class XmrWalletService {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
if (!Boolean.FALSE.equals(connection.isConnected())) wallet.sync();
|
if (!Boolean.FALSE.equals(connection.isConnected())) wallet.sync();
|
||||||
wallet.startSyncing(connectionsService.getRefreshPeriodMs());
|
wallet.startSyncing(xmrConnectionService.getRefreshPeriodMs());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Failed to sync main wallet after setting daemon connection: " + e.getMessage());
|
log.warn("Failed to sync main wallet after setting daemon connection: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2178,7 +2178,7 @@ popup.warn.daoRequiresRestart=There was a problem with synchronizing the DAO sta
|
||||||
|
|
||||||
popup.privateNotification.headline=Important private notification!
|
popup.privateNotification.headline=Important private notification!
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno detected a Monero node running on this machine (at localhost).\n\n\Please ensure the node is fully synced before starting Haveno.
|
popup.xmrLocalNode.msg=Haveno detected a Monero node running on this machine (at localhost).\n\n\Please ensure the node is fully synced before starting Haveno.
|
||||||
popup.shutDownInProgress.headline=Shut down in progress
|
popup.shutDownInProgress.headline=Shut down in progress
|
||||||
popup.shutDownInProgress.msg=Shutting down application can take a few seconds.\nPlease don't interrupt this process.
|
popup.shutDownInProgress.msg=Shutting down application can take a few seconds.\nPlease don't interrupt this process.
|
||||||
|
|
||||||
|
|
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=Důležité soukromé oznámení!
|
||||||
popup.securityRecommendation.headline=Důležité bezpečnostní doporučení
|
popup.securityRecommendation.headline=Důležité bezpečnostní doporučení
|
||||||
popup.securityRecommendation.msg=Chtěli bychom vám připomenout, abyste zvážili použití ochrany heslem pro vaši peněženku, pokud jste ji již neaktivovali.\n\nDůrazně se také doporučuje zapsat seed slova peněženky. Tato seed slova jsou jako hlavní heslo pro obnovení vaší moneroové peněženky.\nV sekci "Seed peněženky" naleznete další informace.\n\nDále byste měli zálohovat úplnou složku dat aplikace v sekci \"Záloha\".
|
popup.securityRecommendation.msg=Chtěli bychom vám připomenout, abyste zvážili použití ochrany heslem pro vaši peněženku, pokud jste ji již neaktivovali.\n\nDůrazně se také doporučuje zapsat seed slova peněženky. Tato seed slova jsou jako hlavní heslo pro obnovení vaší moneroové peněženky.\nV sekci "Seed peněženky" naleznete další informace.\n\nDále byste měli zálohovat úplnou složku dat aplikace v sekci \"Záloha\".
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno zjistil, že na tomto stroji (na localhostu) běží Monero node.\n\nUjistěte se, prosím, že tento node je plně synchronizován před spuštěním Havena.
|
popup.xmrLocalNode.msg=Haveno zjistil, že na tomto stroji (na localhostu) běží Monero node.\n\nUjistěte se, prosím, že tento node je plně synchronizován před spuštěním Havena.
|
||||||
|
|
||||||
popup.shutDownInProgress.headline=Probíhá vypínání
|
popup.shutDownInProgress.headline=Probíhá vypínání
|
||||||
popup.shutDownInProgress.msg=Vypnutí aplikace může trvat několik sekund.\nProsím, nepřerušujte tento proces.
|
popup.shutDownInProgress.msg=Vypnutí aplikace může trvat několik sekund.\nProsím, nepřerušujte tento proces.
|
||||||
|
|
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=Wichtige private Benachrichtigung!
|
||||||
popup.securityRecommendation.headline=Wichtige Sicherheitsempfehlung
|
popup.securityRecommendation.headline=Wichtige Sicherheitsempfehlung
|
||||||
popup.securityRecommendation.msg=Wir würden Sie gerne daran erinnern, sich zu überlegen, den Passwortschutz Ihrer Wallet zu verwenden, falls Sie diesen noch nicht aktiviert haben.\n\nEs wird außerdem dringend empfohlen, dass Sie die Wallet-Seed-Wörter aufschreiben. Diese Seed-Wörter sind wie ein Master-Passwort zum Wiederherstellen ihrer Monero-Wallet.\nIm \"Wallet-Seed\"-Abschnitt finden Sie weitere Informationen.\n\nZusätzlich sollten Sie ein Backup des ganzen Anwendungsdatenordners im \"Backup\"-Abschnitt erstellen.
|
popup.securityRecommendation.msg=Wir würden Sie gerne daran erinnern, sich zu überlegen, den Passwortschutz Ihrer Wallet zu verwenden, falls Sie diesen noch nicht aktiviert haben.\n\nEs wird außerdem dringend empfohlen, dass Sie die Wallet-Seed-Wörter aufschreiben. Diese Seed-Wörter sind wie ein Master-Passwort zum Wiederherstellen ihrer Monero-Wallet.\nIm \"Wallet-Seed\"-Abschnitt finden Sie weitere Informationen.\n\nZusätzlich sollten Sie ein Backup des ganzen Anwendungsdatenordners im \"Backup\"-Abschnitt erstellen.
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno hat einen Monero-Knoten entdeckt, der auf diesem Rechner (auf localhost) läuft.\n\nBitte stellen Sie sicher, dass der Knoten vollständig synchronisiert ist, bevor Sie Haveno starten.
|
popup.xmrLocalNode.msg=Haveno hat einen Monero-Knoten entdeckt, der auf diesem Rechner (auf localhost) läuft.\n\nBitte stellen Sie sicher, dass der Knoten vollständig synchronisiert ist, bevor Sie Haveno starten.
|
||||||
|
|
||||||
popup.shutDownInProgress.headline=Anwendung wird heruntergefahren
|
popup.shutDownInProgress.headline=Anwendung wird heruntergefahren
|
||||||
popup.shutDownInProgress.msg=Das Herunterfahren der Anwendung kann einige Sekunden dauern.\nBitte unterbrechen Sie diesen Vorgang nicht.
|
popup.shutDownInProgress.msg=Das Herunterfahren der Anwendung kann einige Sekunden dauern.\nBitte unterbrechen Sie diesen Vorgang nicht.
|
||||||
|
|
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=Notificación privada importante!
|
||||||
popup.securityRecommendation.headline=Recomendación de seguridad importante
|
popup.securityRecommendation.headline=Recomendación de seguridad importante
|
||||||
popup.securityRecommendation.msg=Nos gustaría recordarle que considere usar protección por contraseña para su cartera, si no la ha activado ya.\n\nTambién es muy recomendable que escriba en un papel las palabras semilla del monedero. Esas palabras semilla son como una contraseña maestra para recuperar su cartera Monero.\nEn la sección \"Semilla de cartera\" encontrará más información.\n\nAdicionalmente, debería hacer una copia de seguridad completa del directorio de aplicación en la sección \"Copia de seguridad\"
|
popup.securityRecommendation.msg=Nos gustaría recordarle que considere usar protección por contraseña para su cartera, si no la ha activado ya.\n\nTambién es muy recomendable que escriba en un papel las palabras semilla del monedero. Esas palabras semilla son como una contraseña maestra para recuperar su cartera Monero.\nEn la sección \"Semilla de cartera\" encontrará más información.\n\nAdicionalmente, debería hacer una copia de seguridad completa del directorio de aplicación en la sección \"Copia de seguridad\"
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno ha detectado un nodo de Monero ejecutándose en esta máquina (en el localhost).\n\nPor favor, asegúrese de que el nodo esté completamente sincronizado antes de iniciar Haveno.
|
popup.xmrLocalNode.msg=Haveno ha detectado un nodo de Monero ejecutándose en esta máquina (en el localhost).\n\nPor favor, asegúrese de que el nodo esté completamente sincronizado antes de iniciar Haveno.
|
||||||
|
|
||||||
popup.shutDownInProgress.headline=Cerrando aplicación...
|
popup.shutDownInProgress.headline=Cerrando aplicación...
|
||||||
popup.shutDownInProgress.msg=Cerrar la aplicación puede llevar unos segundos.\nPor favor no interrumpa el proceso.
|
popup.shutDownInProgress.msg=Cerrar la aplicación puede llevar unos segundos.\nPor favor no interrumpa el proceso.
|
||||||
|
|
|
@ -1625,7 +1625,7 @@ popup.privateNotification.headline=Notification privée importante!
|
||||||
popup.securityRecommendation.headline=Recommendation de sécurité importante
|
popup.securityRecommendation.headline=Recommendation de sécurité importante
|
||||||
popup.securityRecommendation.msg=Nous vous rappelons d'envisager d'utiliser la protection par mot de passe pour votre portefeuille si vous ne l'avez pas déjà activé.\n\nIl est également fortement recommandé d'écrire les mots de la seed de portefeuille. Ces mots de la seed sont comme un mot de passe principal pour récupérer votre portefeuille Monero.\nVous trouverez plus d'informations à ce sujet dans l'onglet \"seed du portefeuille\".\n\nDe plus, il est recommandé de sauvegarder le dossier complet des données de l'application dans l'onglet \"Sauvegarde".
|
popup.securityRecommendation.msg=Nous vous rappelons d'envisager d'utiliser la protection par mot de passe pour votre portefeuille si vous ne l'avez pas déjà activé.\n\nIl est également fortement recommandé d'écrire les mots de la seed de portefeuille. Ces mots de la seed sont comme un mot de passe principal pour récupérer votre portefeuille Monero.\nVous trouverez plus d'informations à ce sujet dans l'onglet \"seed du portefeuille\".\n\nDe plus, il est recommandé de sauvegarder le dossier complet des données de l'application dans l'onglet \"Sauvegarde".
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno a détecté un nœud Monero en cours d'exécution sur cette machine (sur l'hôte local).\n\nVeuillez vous assurer que le nœud est complètement synchronisé avant de démarrer Haveno.
|
popup.xmrLocalNode.msg=Haveno a détecté un nœud Monero en cours d'exécution sur cette machine (sur l'hôte local).\n\nVeuillez vous assurer que le nœud est complètement synchronisé avant de démarrer Haveno.
|
||||||
|
|
||||||
popup.shutDownInProgress.headline=Fermeture en cours
|
popup.shutDownInProgress.headline=Fermeture en cours
|
||||||
popup.shutDownInProgress.msg=La fermeture de l'application nécessite quelques secondes.\nVeuillez ne pas interrompre ce processus.
|
popup.shutDownInProgress.msg=La fermeture de l'application nécessite quelques secondes.\nVeuillez ne pas interrompre ce processus.
|
||||||
|
|
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=重要なプライベート通知!
|
||||||
popup.securityRecommendation.headline=重要なセキュリティ勧告
|
popup.securityRecommendation.headline=重要なセキュリティ勧告
|
||||||
popup.securityRecommendation.msg=ウォレットのパスワード保護をまだ有効にしてない場合は、使用することを検討してください。\n\nウォレットシードワードを書き留めることも強くお勧めします。 これらのシードワードは、あなたのビットコインウォレットを復元するためのマスターパスワードのようなものです。\n「ウォレットシード」セクションにてより詳細な情報を確認できます。\n\nまた、「バックアップ」セクションのアプリケーションデータフォルダ全体をバックアップするべきでしょう。
|
popup.securityRecommendation.msg=ウォレットのパスワード保護をまだ有効にしてない場合は、使用することを検討してください。\n\nウォレットシードワードを書き留めることも強くお勧めします。 これらのシードワードは、あなたのビットコインウォレットを復元するためのマスターパスワードのようなものです。\n「ウォレットシード」セクションにてより詳細な情報を確認できます。\n\nまた、「バックアップ」セクションのアプリケーションデータフォルダ全体をバックアップするべきでしょう。
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno检测到本机(localhost上)运行了一个门罗币节点。\n\n在启动Haveno之前,请确保节点已完全同步。
|
popup.xmrLocalNode.msg=Haveno检测到本机(localhost上)运行了一个门罗币节点。\n\n在启动Haveno之前,请确保节点已完全同步。
|
||||||
|
|
||||||
popup.shutDownInProgress.headline=シャットダウン中
|
popup.shutDownInProgress.headline=シャットダウン中
|
||||||
popup.shutDownInProgress.msg=アプリケーションのシャットダウンには数秒かかることがあります。\nこのプロセスを中断しないでください。
|
popup.shutDownInProgress.msg=アプリケーションのシャットダウンには数秒かかることがあります。\nこのプロセスを中断しないでください。
|
||||||
|
|
|
@ -1628,7 +1628,7 @@ popup.privateNotification.headline=重要私人通知!
|
||||||
popup.securityRecommendation.headline=重要安全建议
|
popup.securityRecommendation.headline=重要安全建议
|
||||||
popup.securityRecommendation.msg=如果您还没有启用,我们想提醒您考虑为您的钱包使用密码保护。\n\n强烈建议你写下钱包还原密钥。 那些还原密钥就是恢复你的比特币钱包的主密码。\n在“钱包密钥”部分,您可以找到更多信息\n\n此外,您应该在“备份”界面备份完整的应用程序数据文件夹。
|
popup.securityRecommendation.msg=如果您还没有启用,我们想提醒您考虑为您的钱包使用密码保护。\n\n强烈建议你写下钱包还原密钥。 那些还原密钥就是恢复你的比特币钱包的主密码。\n在“钱包密钥”部分,您可以找到更多信息\n\n此外,您应该在“备份”界面备份完整的应用程序数据文件夹。
|
||||||
|
|
||||||
popup.moneroLocalhostNode.msg=Haveno 侦测到本机(本地)运行着一个门罗币节点(位于 localhost)。\n\n请确保在启动 Haveno 之前,节点已完全同步。
|
popup.xmrLocalNode.msg=Haveno 侦测到本机(本地)运行着一个门罗币节点(位于 localhost)。\n\n请确保在启动 Haveno 之前,节点已完全同步。
|
||||||
|
|
||||||
popup.shutDownInProgress.headline=正在关闭
|
popup.shutDownInProgress.headline=正在关闭
|
||||||
popup.shutDownInProgress.msg=关闭应用可能会花一点时间。\n请不要打断关闭过程。
|
popup.shutDownInProgress.msg=关闭应用可能会花一点时间。\n请不要打断关闭过程。
|
||||||
|
|
|
@ -7,7 +7,7 @@ import haveno.common.handlers.ErrorMessageHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.api.CoreContext;
|
import haveno.core.api.CoreContext;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.trade.TradableList;
|
import haveno.core.trade.TradableList;
|
||||||
import haveno.network.p2p.P2PService;
|
import haveno.network.p2p.P2PService;
|
||||||
import haveno.network.p2p.peers.PeerManager;
|
import haveno.network.p2p.peers.PeerManager;
|
||||||
|
@ -53,7 +53,7 @@ public class OpenOfferManagerTest {
|
||||||
public void testStartEditOfferForActiveOffer() {
|
public void testStartEditOfferForActiveOffer() {
|
||||||
P2PService p2PService = mock(P2PService.class);
|
P2PService p2PService = mock(P2PService.class);
|
||||||
OfferBookService offerBookService = mock(OfferBookService.class);
|
OfferBookService offerBookService = mock(OfferBookService.class);
|
||||||
CoreMoneroConnectionsService connectionsService = mock(CoreMoneroConnectionsService.class);
|
XmrConnectionService xmrConnectionService = mock(XmrConnectionService.class);
|
||||||
|
|
||||||
when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class));
|
when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class));
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public class OpenOfferManagerTest {
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
p2PService,
|
p2PService,
|
||||||
connectionsService,
|
xmrConnectionService,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
@ -102,14 +102,14 @@ public class OpenOfferManagerTest {
|
||||||
public void testStartEditOfferForDeactivatedOffer() {
|
public void testStartEditOfferForDeactivatedOffer() {
|
||||||
P2PService p2PService = mock(P2PService.class);
|
P2PService p2PService = mock(P2PService.class);
|
||||||
OfferBookService offerBookService = mock(OfferBookService.class);
|
OfferBookService offerBookService = mock(OfferBookService.class);
|
||||||
CoreMoneroConnectionsService connectionsService = mock(CoreMoneroConnectionsService.class);
|
XmrConnectionService xmrConnectionService = mock(XmrConnectionService.class);
|
||||||
when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class));
|
when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class));
|
||||||
|
|
||||||
final OpenOfferManager manager = new OpenOfferManager(coreContext,
|
final OpenOfferManager manager = new OpenOfferManager(coreContext,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
p2PService,
|
p2PService,
|
||||||
connectionsService,
|
xmrConnectionService,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
@ -142,7 +142,7 @@ public class OpenOfferManagerTest {
|
||||||
public void testStartEditOfferForOfferThatIsCurrentlyEdited() {
|
public void testStartEditOfferForOfferThatIsCurrentlyEdited() {
|
||||||
P2PService p2PService = mock(P2PService.class);
|
P2PService p2PService = mock(P2PService.class);
|
||||||
OfferBookService offerBookService = mock(OfferBookService.class);
|
OfferBookService offerBookService = mock(OfferBookService.class);
|
||||||
CoreMoneroConnectionsService connectionsService = mock(CoreMoneroConnectionsService.class);
|
XmrConnectionService xmrConnectionService = mock(XmrConnectionService.class);
|
||||||
|
|
||||||
when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class));
|
when(p2PService.getPeerManager()).thenReturn(mock(PeerManager.class));
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ public class OpenOfferManagerTest {
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
p2PService,
|
p2PService,
|
||||||
connectionsService,
|
xmrConnectionService,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
|
@ -19,7 +19,7 @@ package haveno.core.user;
|
||||||
|
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.api.LocalMoneroNode;
|
import haveno.core.api.XmrLocalNode;
|
||||||
import haveno.core.locale.CountryUtil;
|
import haveno.core.locale.CountryUtil;
|
||||||
import haveno.core.locale.CryptoCurrency;
|
import haveno.core.locale.CryptoCurrency;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
|
@ -56,7 +56,7 @@ public class PreferencesTest {
|
||||||
|
|
||||||
persistenceManager = mock(PersistenceManager.class);
|
persistenceManager = mock(PersistenceManager.class);
|
||||||
Config config = new Config();
|
Config config = new Config();
|
||||||
LocalMoneroNode localMoneroNode = new LocalMoneroNode(config, preferences);
|
XmrLocalNode xmrLocalNode = new XmrLocalNode(config, preferences);
|
||||||
preferences = new Preferences(
|
preferences = new Preferences(
|
||||||
persistenceManager, config, null);
|
persistenceManager, config, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,8 @@ public class GrpcServer {
|
||||||
GrpcTradesService tradesService,
|
GrpcTradesService tradesService,
|
||||||
GrpcWalletsService walletsService,
|
GrpcWalletsService walletsService,
|
||||||
GrpcNotificationsService notificationsService,
|
GrpcNotificationsService notificationsService,
|
||||||
GrpcMoneroConnectionsService moneroConnectionsService,
|
GrpcXmrConnectionService moneroConnectionsService,
|
||||||
GrpcMoneroNodeService moneroNodeService) {
|
GrpcXmrNodeService moneroNodeService) {
|
||||||
this.server = ServerBuilder.forPort(config.apiPort)
|
this.server = ServerBuilder.forPort(config.apiPort)
|
||||||
.addService(interceptForward(accountService, accountService.interceptors()))
|
.addService(interceptForward(accountService, accountService.interceptors()))
|
||||||
.addService(interceptForward(disputeAgentsService, disputeAgentsService.interceptors()))
|
.addService(interceptForward(disputeAgentsService, disputeAgentsService.interceptors()))
|
||||||
|
|
|
@ -57,28 +57,28 @@ import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.MoneroConnectionsImplBase;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.XmrConnectionsImplBase;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getAddConnectionMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getAddConnectionMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getCheckConnectionMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getCheckConnectionMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getCheckConnectionsMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getCheckConnectionsMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getGetBestAvailableConnectionMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getGetBestAvailableConnectionMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getGetConnectionMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getGetConnectionMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getGetConnectionsMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getGetConnectionsMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getRemoveConnectionMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getRemoveConnectionMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getSetAutoSwitchMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getSetAutoSwitchMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getSetConnectionMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getSetConnectionMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getStartCheckingConnectionsMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getStartCheckingConnectionsMethod;
|
||||||
import static haveno.proto.grpc.MoneroConnectionsGrpc.getStopCheckingConnectionsMethod;
|
import static haveno.proto.grpc.XmrConnectionsGrpc.getStopCheckingConnectionsMethod;
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class GrpcMoneroConnectionsService extends MoneroConnectionsImplBase {
|
class GrpcXmrConnectionService extends XmrConnectionsImplBase {
|
||||||
|
|
||||||
private final CoreApi coreApi;
|
private final CoreApi coreApi;
|
||||||
private final GrpcExceptionHandler exceptionHandler;
|
private final GrpcExceptionHandler exceptionHandler;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public GrpcMoneroConnectionsService(CoreApi coreApi, GrpcExceptionHandler exceptionHandler) {
|
public GrpcXmrConnectionService(CoreApi coreApi, GrpcExceptionHandler exceptionHandler) {
|
||||||
this.coreApi = coreApi;
|
this.coreApi = coreApi;
|
||||||
this.exceptionHandler = exceptionHandler;
|
this.exceptionHandler = exceptionHandler;
|
||||||
}
|
}
|
||||||
|
@ -118,9 +118,9 @@ class GrpcMoneroConnectionsService extends MoneroConnectionsImplBase {
|
||||||
public void getConnections(GetConnectionsRequest request,
|
public void getConnections(GetConnectionsRequest request,
|
||||||
StreamObserver<GetConnectionsReply> responseObserver) {
|
StreamObserver<GetConnectionsReply> responseObserver) {
|
||||||
handleRequest(responseObserver, () -> {
|
handleRequest(responseObserver, () -> {
|
||||||
List<MoneroRpcConnection> connections = coreApi.getMoneroConnections();
|
List<MoneroRpcConnection> connections = coreApi.getXmrConnections();
|
||||||
List<UrlConnection> replyConnections = connections.stream()
|
List<UrlConnection> replyConnections = connections.stream()
|
||||||
.map(GrpcMoneroConnectionsService::toUrlConnection).collect(Collectors.toList());
|
.map(GrpcXmrConnectionService::toUrlConnection).collect(Collectors.toList());
|
||||||
return GetConnectionsReply.newBuilder().addAllConnections(replyConnections).build();
|
return GetConnectionsReply.newBuilder().addAllConnections(replyConnections).build();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -156,9 +156,9 @@ class GrpcMoneroConnectionsService extends MoneroConnectionsImplBase {
|
||||||
public void checkConnections(CheckConnectionsRequest request,
|
public void checkConnections(CheckConnectionsRequest request,
|
||||||
StreamObserver<CheckConnectionsReply> responseObserver) {
|
StreamObserver<CheckConnectionsReply> responseObserver) {
|
||||||
handleRequest(responseObserver, () -> {
|
handleRequest(responseObserver, () -> {
|
||||||
List<MoneroRpcConnection> connections = coreApi.checkMoneroConnections();
|
List<MoneroRpcConnection> connections = coreApi.checkXmrConnections();
|
||||||
List<UrlConnection> replyConnections = connections.stream()
|
List<UrlConnection> replyConnections = connections.stream()
|
||||||
.map(GrpcMoneroConnectionsService::toUrlConnection).collect(Collectors.toList());
|
.map(GrpcXmrConnectionService::toUrlConnection).collect(Collectors.toList());
|
||||||
return CheckConnectionsReply.newBuilder().addAllConnections(replyConnections).build();
|
return CheckConnectionsReply.newBuilder().addAllConnections(replyConnections).build();
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -17,18 +17,18 @@
|
||||||
package haveno.daemon.grpc;
|
package haveno.daemon.grpc;
|
||||||
|
|
||||||
import haveno.core.api.CoreApi;
|
import haveno.core.api.CoreApi;
|
||||||
import haveno.core.xmr.MoneroNodeSettings;
|
import haveno.core.xmr.XmrNodeSettings;
|
||||||
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
import haveno.daemon.grpc.interceptor.CallRateMeteringInterceptor;
|
||||||
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
import haveno.daemon.grpc.interceptor.GrpcCallRateMeter;
|
||||||
import haveno.proto.grpc.GetMoneroNodeSettingsReply;
|
import haveno.proto.grpc.GetXmrNodeSettingsReply;
|
||||||
import haveno.proto.grpc.GetMoneroNodeSettingsRequest;
|
import haveno.proto.grpc.GetXmrNodeSettingsRequest;
|
||||||
import haveno.proto.grpc.IsMoneroNodeOnlineReply;
|
import haveno.proto.grpc.IsXmrNodeOnlineReply;
|
||||||
import haveno.proto.grpc.IsMoneroNodeOnlineRequest;
|
import haveno.proto.grpc.IsXmrNodeOnlineRequest;
|
||||||
import haveno.proto.grpc.MoneroNodeGrpc.MoneroNodeImplBase;
|
import haveno.proto.grpc.XmrNodeGrpc.XmrNodeImplBase;
|
||||||
import haveno.proto.grpc.StartMoneroNodeReply;
|
import haveno.proto.grpc.StartXmrNodeReply;
|
||||||
import haveno.proto.grpc.StartMoneroNodeRequest;
|
import haveno.proto.grpc.StartXmrNodeRequest;
|
||||||
import haveno.proto.grpc.StopMoneroNodeReply;
|
import haveno.proto.grpc.StopXmrNodeReply;
|
||||||
import haveno.proto.grpc.StopMoneroNodeRequest;
|
import haveno.proto.grpc.StopXmrNodeRequest;
|
||||||
import io.grpc.ServerInterceptor;
|
import io.grpc.ServerInterceptor;
|
||||||
import io.grpc.stub.StreamObserver;
|
import io.grpc.stub.StreamObserver;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -39,30 +39,30 @@ import java.util.HashMap;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
import static haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig.getCustomRateMeteringInterceptor;
|
||||||
import static haveno.proto.grpc.MoneroNodeGrpc.getGetMoneroNodeSettingsMethod;
|
import static haveno.proto.grpc.XmrNodeGrpc.getGetXmrNodeSettingsMethod;
|
||||||
import static haveno.proto.grpc.MoneroNodeGrpc.getIsMoneroNodeOnlineMethod;
|
import static haveno.proto.grpc.XmrNodeGrpc.getIsXmrNodeOnlineMethod;
|
||||||
import static haveno.proto.grpc.MoneroNodeGrpc.getStartMoneroNodeMethod;
|
import static haveno.proto.grpc.XmrNodeGrpc.getStartXmrNodeMethod;
|
||||||
import static haveno.proto.grpc.MoneroNodeGrpc.getStopMoneroNodeMethod;
|
import static haveno.proto.grpc.XmrNodeGrpc.getStopXmrNodeMethod;
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GrpcMoneroNodeService extends MoneroNodeImplBase {
|
public class GrpcXmrNodeService extends XmrNodeImplBase {
|
||||||
|
|
||||||
private final CoreApi coreApi;
|
private final CoreApi coreApi;
|
||||||
private final GrpcExceptionHandler exceptionHandler;
|
private final GrpcExceptionHandler exceptionHandler;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public GrpcMoneroNodeService(CoreApi coreApi, GrpcExceptionHandler exceptionHandler) {
|
public GrpcXmrNodeService(CoreApi coreApi, GrpcExceptionHandler exceptionHandler) {
|
||||||
this.coreApi = coreApi;
|
this.coreApi = coreApi;
|
||||||
this.exceptionHandler = exceptionHandler;
|
this.exceptionHandler = exceptionHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void isMoneroNodeOnline(IsMoneroNodeOnlineRequest request,
|
public void isXmrNodeOnline(IsXmrNodeOnlineRequest request,
|
||||||
StreamObserver<IsMoneroNodeOnlineReply> responseObserver) {
|
StreamObserver<IsXmrNodeOnlineReply> responseObserver) {
|
||||||
try {
|
try {
|
||||||
var reply = IsMoneroNodeOnlineReply.newBuilder()
|
var reply = IsXmrNodeOnlineReply.newBuilder()
|
||||||
.setIsRunning(coreApi.isMoneroNodeOnline())
|
.setIsRunning(coreApi.isXmrNodeOnline())
|
||||||
.build();
|
.build();
|
||||||
responseObserver.onNext(reply);
|
responseObserver.onNext(reply);
|
||||||
responseObserver.onCompleted();
|
responseObserver.onCompleted();
|
||||||
|
@ -72,11 +72,11 @@ public class GrpcMoneroNodeService extends MoneroNodeImplBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getMoneroNodeSettings(GetMoneroNodeSettingsRequest request,
|
public void getXmrNodeSettings(GetXmrNodeSettingsRequest request,
|
||||||
StreamObserver<GetMoneroNodeSettingsReply> responseObserver) {
|
StreamObserver<GetXmrNodeSettingsReply> responseObserver) {
|
||||||
try {
|
try {
|
||||||
var settings = coreApi.getMoneroNodeSettings();
|
var settings = coreApi.getXmrNodeSettings();
|
||||||
var builder = GetMoneroNodeSettingsReply.newBuilder();
|
var builder = GetXmrNodeSettingsReply.newBuilder();
|
||||||
if (settings != null) {
|
if (settings != null) {
|
||||||
builder.setSettings(settings.toProtoMessage());
|
builder.setSettings(settings.toProtoMessage());
|
||||||
}
|
}
|
||||||
|
@ -89,12 +89,12 @@ public class GrpcMoneroNodeService extends MoneroNodeImplBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startMoneroNode(StartMoneroNodeRequest request,
|
public void startXmrNode(StartXmrNodeRequest request,
|
||||||
StreamObserver<StartMoneroNodeReply> responseObserver) {
|
StreamObserver<StartXmrNodeReply> responseObserver) {
|
||||||
try {
|
try {
|
||||||
var settings = request.getSettings();
|
var settings = request.getSettings();
|
||||||
coreApi.startMoneroNode(MoneroNodeSettings.fromProto(settings));
|
coreApi.startXmrNode(XmrNodeSettings.fromProto(settings));
|
||||||
var reply = StartMoneroNodeReply.newBuilder().build();
|
var reply = StartXmrNodeReply.newBuilder().build();
|
||||||
responseObserver.onNext(reply);
|
responseObserver.onNext(reply);
|
||||||
responseObserver.onCompleted();
|
responseObserver.onCompleted();
|
||||||
} catch (MoneroError me) {
|
} catch (MoneroError me) {
|
||||||
|
@ -105,11 +105,11 @@ public class GrpcMoneroNodeService extends MoneroNodeImplBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopMoneroNode(StopMoneroNodeRequest request,
|
public void stopXmrNode(StopXmrNodeRequest request,
|
||||||
StreamObserver<StopMoneroNodeReply> responseObserver) {
|
StreamObserver<StopXmrNodeReply> responseObserver) {
|
||||||
try {
|
try {
|
||||||
coreApi.stopMoneroNode();
|
coreApi.stopXmrNode();
|
||||||
var reply = StopMoneroNodeReply.newBuilder().build();
|
var reply = StopXmrNodeReply.newBuilder().build();
|
||||||
responseObserver.onNext(reply);
|
responseObserver.onNext(reply);
|
||||||
responseObserver.onCompleted();
|
responseObserver.onCompleted();
|
||||||
} catch (MoneroError me) {
|
} catch (MoneroError me) {
|
||||||
|
@ -141,10 +141,10 @@ public class GrpcMoneroNodeService extends MoneroNodeImplBase {
|
||||||
.or(() -> Optional.of(CallRateMeteringInterceptor.valueOf(
|
.or(() -> Optional.of(CallRateMeteringInterceptor.valueOf(
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
int allowedCallsPerTimeWindow = 10;
|
int allowedCallsPerTimeWindow = 10;
|
||||||
put(getIsMoneroNodeOnlineMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
put(getIsXmrNodeOnlineMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
||||||
put(getGetMoneroNodeSettingsMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
put(getGetXmrNodeSettingsMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
||||||
put(getStartMoneroNodeMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
put(getStartXmrNodeMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
||||||
put(getStopMoneroNodeMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
put(getStopXmrNodeMethod().getFullMethodName(), new GrpcCallRateMeter(allowedCallsPerTimeWindow, SECONDS));
|
||||||
}}
|
}}
|
||||||
)));
|
)));
|
||||||
}
|
}
|
|
@ -29,7 +29,7 @@ import haveno.common.util.Tuple2;
|
||||||
import haveno.core.account.sign.SignedWitnessService;
|
import haveno.core.account.sign.SignedWitnessService;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.alert.PrivateNotificationManager;
|
import haveno.core.alert.PrivateNotificationManager;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.app.HavenoSetup;
|
import haveno.core.app.HavenoSetup;
|
||||||
import haveno.core.locale.CryptoCurrency;
|
import haveno.core.locale.CryptoCurrency;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
|
@ -103,7 +103,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener {
|
public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener {
|
||||||
private final HavenoSetup havenoSetup;
|
private final HavenoSetup havenoSetup;
|
||||||
private final CoreMoneroConnectionsService connectionService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
private final User user;
|
private final User user;
|
||||||
private final BalancePresentation balancePresentation;
|
private final BalancePresentation balancePresentation;
|
||||||
private final TradePresentation tradePresentation;
|
private final TradePresentation tradePresentation;
|
||||||
|
@ -147,7 +147,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public MainViewModel(HavenoSetup havenoSetup,
|
public MainViewModel(HavenoSetup havenoSetup,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
XmrWalletService xmrWalletService,
|
XmrWalletService xmrWalletService,
|
||||||
User user,
|
User user,
|
||||||
BalancePresentation balancePresentation,
|
BalancePresentation balancePresentation,
|
||||||
|
@ -171,7 +171,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||||
CorruptedStorageFileHandler corruptedStorageFileHandler,
|
CorruptedStorageFileHandler corruptedStorageFileHandler,
|
||||||
Navigation navigation) {
|
Navigation navigation) {
|
||||||
this.havenoSetup = havenoSetup;
|
this.havenoSetup = havenoSetup;
|
||||||
this.connectionService = connectionService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.balancePresentation = balancePresentation;
|
this.balancePresentation = balancePresentation;
|
||||||
this.tradePresentation = tradePresentation;
|
this.tradePresentation = tradePresentation;
|
||||||
|
@ -359,7 +359,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||||
havenoSetup.setDisplaySecurityRecommendationHandler(key -> {});
|
havenoSetup.setDisplaySecurityRecommendationHandler(key -> {});
|
||||||
havenoSetup.setDisplayLocalhostHandler(key -> {
|
havenoSetup.setDisplayLocalhostHandler(key -> {
|
||||||
if (!DevEnv.isDevMode()) {
|
if (!DevEnv.isDevMode()) {
|
||||||
Popup popup = new Popup().backgroundInfo(Res.get("popup.moneroLocalhostNode.msg"))
|
Popup popup = new Popup().backgroundInfo(Res.get("popup.xmrLocalNode.msg"))
|
||||||
.dontShowAgainId(key);
|
.dontShowAgainId(key);
|
||||||
popup.setDisplayOrderPriority(5);
|
popup.setDisplayOrderPriority(5);
|
||||||
popupQueue.add(popup);
|
popupQueue.add(popup);
|
||||||
|
|
|
@ -20,7 +20,7 @@ package haveno.desktop.main.funds.transactions;
|
||||||
import com.googlecode.jcsv.writer.CSVEntryConverter;
|
import com.googlecode.jcsv.writer.CSVEntryConverter;
|
||||||
import de.jensd.fx.fontawesome.AwesomeIcon;
|
import de.jensd.fx.fontawesome.AwesomeIcon;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.OpenOffer;
|
import haveno.core.offer.OpenOffer;
|
||||||
import haveno.core.trade.Trade;
|
import haveno.core.trade.Trade;
|
||||||
|
@ -110,7 +110,7 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
|
||||||
@Inject
|
@Inject
|
||||||
private TransactionsView(XmrWalletService xmrWalletService,
|
private TransactionsView(XmrWalletService xmrWalletService,
|
||||||
P2PService p2PService,
|
P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
Preferences preferences,
|
Preferences preferences,
|
||||||
TradeDetailsWindow tradeDetailsWindow,
|
TradeDetailsWindow tradeDetailsWindow,
|
||||||
OfferDetailsWindow offerDetailsWindow,
|
OfferDetailsWindow offerDetailsWindow,
|
||||||
|
|
|
@ -553,7 +553,7 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
||||||
|
|
||||||
boolean canCreateOrTakeOffer() {
|
boolean canCreateOrTakeOffer() {
|
||||||
return GUIUtil.canCreateOrTakeOfferOrShowPopup(user, navigation) &&
|
return GUIUtil.canCreateOrTakeOfferOrShowPopup(user, navigation) &&
|
||||||
GUIUtil.isChainHeightSyncedWithinToleranceOrShowPopup(openOfferManager.getConnectionsService()) &&
|
GUIUtil.isChainHeightSyncedWithinToleranceOrShowPopup(openOfferManager.getXmrConnectionService()) &&
|
||||||
GUIUtil.isBootstrappedOrShowPopup(p2PService);
|
GUIUtil.isBootstrappedOrShowPopup(p2PService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import haveno.common.handlers.FaultHandler;
|
||||||
import haveno.common.handlers.ResultHandler;
|
import haveno.common.handlers.ResultHandler;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.api.CoreDisputesService;
|
import haveno.core.api.CoreDisputesService;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.offer.Offer;
|
import haveno.core.offer.Offer;
|
||||||
import haveno.core.offer.OfferDirection;
|
import haveno.core.offer.OfferDirection;
|
||||||
|
@ -89,7 +89,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
public final ArbitrationManager arbitrationManager;
|
public final ArbitrationManager arbitrationManager;
|
||||||
public final MediationManager mediationManager;
|
public final MediationManager mediationManager;
|
||||||
private final P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
private final CoreMoneroConnectionsService connectionService;
|
private final XmrConnectionService xmrConnectionService;
|
||||||
@Getter
|
@Getter
|
||||||
private final AccountAgeWitnessService accountAgeWitnessService;
|
private final AccountAgeWitnessService accountAgeWitnessService;
|
||||||
public final Navigation navigation;
|
public final Navigation navigation;
|
||||||
|
@ -129,7 +129,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
TraderChatManager traderChatManager,
|
TraderChatManager traderChatManager,
|
||||||
Preferences preferences,
|
Preferences preferences,
|
||||||
P2PService p2PService,
|
P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionService,
|
XmrConnectionService xmrConnectionService,
|
||||||
AccountAgeWitnessService accountAgeWitnessService,
|
AccountAgeWitnessService accountAgeWitnessService,
|
||||||
Navigation navigation,
|
Navigation navigation,
|
||||||
WalletPasswordWindow walletPasswordWindow,
|
WalletPasswordWindow walletPasswordWindow,
|
||||||
|
@ -145,7 +145,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
this.traderChatManager = traderChatManager;
|
this.traderChatManager = traderChatManager;
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
this.p2PService = p2PService;
|
this.p2PService = p2PService;
|
||||||
this.connectionService = connectionService;
|
this.xmrConnectionService = xmrConnectionService;
|
||||||
this.accountAgeWitnessService = accountAgeWitnessService;
|
this.accountAgeWitnessService = accountAgeWitnessService;
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
this.walletPasswordWindow = walletPasswordWindow;
|
this.walletPasswordWindow = walletPasswordWindow;
|
||||||
|
@ -544,7 +544,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReadyForTxBroadcast() {
|
public boolean isReadyForTxBroadcast() {
|
||||||
return GUIUtil.isBootstrappedOrShowPopup(p2PService) && GUIUtil.isReadyForTxBroadcastOrShowPopup(connectionService);
|
return GUIUtil.isBootstrappedOrShowPopup(p2PService) && GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrConnectionService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBootstrappedOrShowPopup() {
|
public boolean isBootstrappedOrShowPopup() {
|
||||||
|
|
|
@ -19,8 +19,8 @@ package haveno.desktop.main.settings.network;
|
||||||
|
|
||||||
import haveno.common.ClockWatcher;
|
import haveno.common.ClockWatcher;
|
||||||
import haveno.common.UserThread;
|
import haveno.common.UserThread;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.api.LocalMoneroNode;
|
import haveno.core.api.XmrLocalNode;
|
||||||
import haveno.core.filter.Filter;
|
import haveno.core.filter.Filter;
|
||||||
import haveno.core.filter.FilterManager;
|
import haveno.core.filter.FilterManager;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
|
@ -103,12 +103,12 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
private final XmrNodes xmrNodes;
|
private final XmrNodes xmrNodes;
|
||||||
private final FilterManager filterManager;
|
private final FilterManager filterManager;
|
||||||
private final LocalMoneroNode localMoneroNode;
|
private final XmrLocalNode xmrLocalNode;
|
||||||
private final TorNetworkSettingsWindow torNetworkSettingsWindow;
|
private final TorNetworkSettingsWindow torNetworkSettingsWindow;
|
||||||
private final ClockWatcher clockWatcher;
|
private final ClockWatcher clockWatcher;
|
||||||
private final WalletsSetup walletsSetup;
|
private final WalletsSetup walletsSetup;
|
||||||
private final P2PService p2PService;
|
private final P2PService p2PService;
|
||||||
private final CoreMoneroConnectionsService connectionManager;
|
private final XmrConnectionService connectionManager;
|
||||||
|
|
||||||
private final ObservableList<P2pNetworkListItem> p2pNetworkListItems = FXCollections.observableArrayList();
|
private final ObservableList<P2pNetworkListItem> p2pNetworkListItems = FXCollections.observableArrayList();
|
||||||
private final SortedList<P2pNetworkListItem> p2pSortedList = new SortedList<>(p2pNetworkListItems);
|
private final SortedList<P2pNetworkListItem> p2pSortedList = new SortedList<>(p2pNetworkListItems);
|
||||||
|
@ -132,11 +132,11 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||||
@Inject
|
@Inject
|
||||||
public NetworkSettingsView(WalletsSetup walletsSetup,
|
public NetworkSettingsView(WalletsSetup walletsSetup,
|
||||||
P2PService p2PService,
|
P2PService p2PService,
|
||||||
CoreMoneroConnectionsService connectionManager,
|
XmrConnectionService connectionManager,
|
||||||
Preferences preferences,
|
Preferences preferences,
|
||||||
XmrNodes xmrNodes,
|
XmrNodes xmrNodes,
|
||||||
FilterManager filterManager,
|
FilterManager filterManager,
|
||||||
LocalMoneroNode localMoneroNode,
|
XmrLocalNode xmrLocalNode,
|
||||||
TorNetworkSettingsWindow torNetworkSettingsWindow,
|
TorNetworkSettingsWindow torNetworkSettingsWindow,
|
||||||
ClockWatcher clockWatcher) {
|
ClockWatcher clockWatcher) {
|
||||||
super();
|
super();
|
||||||
|
@ -146,7 +146,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
this.xmrNodes = xmrNodes;
|
this.xmrNodes = xmrNodes;
|
||||||
this.filterManager = filterManager;
|
this.filterManager = filterManager;
|
||||||
this.localMoneroNode = localMoneroNode;
|
this.xmrLocalNode = xmrLocalNode;
|
||||||
this.torNetworkSettingsWindow = torNetworkSettingsWindow;
|
this.torNetworkSettingsWindow = torNetworkSettingsWindow;
|
||||||
this.clockWatcher = clockWatcher;
|
this.clockWatcher = clockWatcher;
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onMoneroPeersToggleSelected(boolean calledFromUser) {
|
private void onMoneroPeersToggleSelected(boolean calledFromUser) {
|
||||||
boolean localMoneroNodeShouldBeUsed = localMoneroNode.shouldBeUsed();
|
boolean localMoneroNodeShouldBeUsed = xmrLocalNode.shouldBeUsed();
|
||||||
useTorForXmrLabel.setDisable(localMoneroNodeShouldBeUsed);
|
useTorForXmrLabel.setDisable(localMoneroNodeShouldBeUsed);
|
||||||
moneroNodesLabel.setDisable(localMoneroNodeShouldBeUsed);
|
moneroNodesLabel.setDisable(localMoneroNodeShouldBeUsed);
|
||||||
xmrNodesLabel.setDisable(localMoneroNodeShouldBeUsed);
|
xmrNodesLabel.setDisable(localMoneroNodeShouldBeUsed);
|
||||||
|
@ -501,7 +501,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||||
|
|
||||||
private void applyPreventPublicXmrNetwork() {
|
private void applyPreventPublicXmrNetwork() {
|
||||||
final boolean preventPublicXmrNetwork = isPreventPublicXmrNetwork();
|
final boolean preventPublicXmrNetwork = isPreventPublicXmrNetwork();
|
||||||
usePublicNodesRadio.setDisable(localMoneroNode.shouldBeUsed() || preventPublicXmrNetwork);
|
usePublicNodesRadio.setDisable(xmrLocalNode.shouldBeUsed() || preventPublicXmrNetwork);
|
||||||
if (preventPublicXmrNetwork && selectedMoneroNodesOption == XmrNodes.MoneroNodesOption.PUBLIC) {
|
if (preventPublicXmrNetwork && selectedMoneroNodesOption == XmrNodes.MoneroNodesOption.PUBLIC) {
|
||||||
selectedMoneroNodesOption = XmrNodes.MoneroNodesOption.PROVIDED;
|
selectedMoneroNodesOption = XmrNodes.MoneroNodesOption.PROVIDED;
|
||||||
preferences.setMoneroNodesOptionOrdinal(selectedMoneroNodesOption.ordinal());
|
preferences.setMoneroNodesOptionOrdinal(selectedMoneroNodesOption.ordinal());
|
||||||
|
|
|
@ -38,7 +38,7 @@ import haveno.common.util.Tuple3;
|
||||||
import haveno.common.util.Utilities;
|
import haveno.common.util.Utilities;
|
||||||
import haveno.core.account.witness.AccountAgeWitness;
|
import haveno.core.account.witness.AccountAgeWitness;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.api.CoreMoneroConnectionsService;
|
import haveno.core.api.XmrConnectionService;
|
||||||
import haveno.core.locale.Country;
|
import haveno.core.locale.Country;
|
||||||
import haveno.core.locale.CountryUtil;
|
import haveno.core.locale.CountryUtil;
|
||||||
import haveno.core.locale.CurrencyUtil;
|
import haveno.core.locale.CurrencyUtil;
|
||||||
|
@ -689,19 +689,19 @@ public class GUIUtil {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isReadyForTxBroadcastOrShowPopup(CoreMoneroConnectionsService connectionService) {
|
public static boolean isReadyForTxBroadcastOrShowPopup(XmrConnectionService xmrConnectionService) {
|
||||||
if (!connectionService.hasSufficientPeersForBroadcast()) {
|
if (!xmrConnectionService.hasSufficientPeersForBroadcast()) {
|
||||||
new Popup().information(Res.get("popup.warning.notSufficientConnectionsToXmrNetwork", connectionService.getMinBroadcastConnections())).show();
|
new Popup().information(Res.get("popup.warning.notSufficientConnectionsToXmrNetwork", xmrConnectionService.getMinBroadcastConnections())).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connectionService.isDownloadComplete()) {
|
if (!xmrConnectionService.isDownloadComplete()) {
|
||||||
new Popup().information(Res.get("popup.warning.downloadNotComplete")).show();
|
new Popup().information(Res.get("popup.warning.downloadNotComplete")).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
connectionService.verifyConnection();
|
xmrConnectionService.verifyConnection();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
new Popup().information(e.getMessage()).show();
|
new Popup().information(e.getMessage()).show();
|
||||||
return false;
|
return false;
|
||||||
|
@ -710,8 +710,8 @@ public class GUIUtil {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isChainHeightSyncedWithinToleranceOrShowPopup(CoreMoneroConnectionsService connectionService) {
|
public static boolean isChainHeightSyncedWithinToleranceOrShowPopup(XmrConnectionService xmrConnectionService) {
|
||||||
if (!connectionService.isSyncedWithinTolerance()) {
|
if (!xmrConnectionService.isSyncedWithinTolerance()) {
|
||||||
new Popup().information(Res.get("popup.warning.chainNotSynced")).show();
|
new Popup().information(Res.get("popup.warning.chainNotSynced")).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import com.natpryce.makeiteasy.Property;
|
||||||
import com.natpryce.makeiteasy.SameValueDonor;
|
import com.natpryce.makeiteasy.SameValueDonor;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.common.persistence.PersistenceManager;
|
import haveno.common.persistence.PersistenceManager;
|
||||||
import haveno.core.api.LocalMoneroNode;
|
import haveno.core.api.XmrLocalNode;
|
||||||
import haveno.core.user.Preferences;
|
import haveno.core.user.Preferences;
|
||||||
|
|
||||||
import static com.natpryce.makeiteasy.MakeItEasy.a;
|
import static com.natpryce.makeiteasy.MakeItEasy.a;
|
||||||
|
@ -32,7 +32,7 @@ public class PreferenceMakers {
|
||||||
|
|
||||||
public static final Property<Preferences, PersistenceManager> storage = new Property<>();
|
public static final Property<Preferences, PersistenceManager> storage = new Property<>();
|
||||||
public static final Property<Preferences, Config> config = new Property<>();
|
public static final Property<Preferences, Config> config = new Property<>();
|
||||||
public static final Property<Preferences, LocalMoneroNode> localMoneroNode = new Property<>();
|
public static final Property<Preferences, XmrLocalNode> xmrLocalNode = new Property<>();
|
||||||
public static final Property<Preferences, String> useTorFlagFromOptions = new Property<>();
|
public static final Property<Preferences, String> useTorFlagFromOptions = new Property<>();
|
||||||
public static final Property<Preferences, String> referralID = new Property<>();
|
public static final Property<Preferences, String> referralID = new Property<>();
|
||||||
|
|
||||||
|
|
|
@ -280,10 +280,10 @@ message SendNotificationReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// MoneroConnections
|
// XmrConnections
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
service MoneroConnections {
|
service XmrConnections {
|
||||||
rpc AddConnection (AddConnectionRequest) returns (AddConnectionReply) {
|
rpc AddConnection (AddConnectionRequest) returns (AddConnectionReply) {
|
||||||
}
|
}
|
||||||
rpc RemoveConnection(RemoveConnectionRequest) returns (RemoveConnectionReply) {
|
rpc RemoveConnection(RemoveConnectionRequest) returns (RemoveConnectionReply) {
|
||||||
|
@ -394,45 +394,45 @@ message SetAutoSwitchRequest {
|
||||||
message SetAutoSwitchReply {}
|
message SetAutoSwitchReply {}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// MoneroNode
|
// XmrNode
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
service MoneroNode {
|
service XmrNode {
|
||||||
rpc IsMoneroNodeOnline (IsMoneroNodeOnlineRequest) returns (IsMoneroNodeOnlineReply) {
|
rpc IsXmrNodeOnline (IsXmrNodeOnlineRequest) returns (IsXmrNodeOnlineReply) {
|
||||||
}
|
}
|
||||||
rpc GetMoneroNodeSettings (GetMoneroNodeSettingsRequest) returns (GetMoneroNodeSettingsReply) {
|
rpc GetXmrNodeSettings (GetXmrNodeSettingsRequest) returns (GetXmrNodeSettingsReply) {
|
||||||
}
|
}
|
||||||
rpc StartMoneroNode (StartMoneroNodeRequest) returns (StartMoneroNodeReply) {
|
rpc StartXmrNode (StartXmrNodeRequest) returns (StartXmrNodeReply) {
|
||||||
}
|
}
|
||||||
rpc StopMoneroNode (StopMoneroNodeRequest) returns (StopMoneroNodeReply) {
|
rpc StopXmrNode (StopXmrNodeRequest) returns (StopXmrNodeReply) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message IsMoneroNodeOnlineRequest {
|
message IsXmrNodeOnlineRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message IsMoneroNodeOnlineReply {
|
message IsXmrNodeOnlineReply {
|
||||||
bool is_running = 1;
|
bool is_running = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetMoneroNodeSettingsRequest {
|
message GetXmrNodeSettingsRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetMoneroNodeSettingsReply {
|
message GetXmrNodeSettingsReply {
|
||||||
MoneroNodeSettings settings = 1; // pb.proto
|
XmrNodeSettings settings = 1; // pb.proto
|
||||||
}
|
}
|
||||||
|
|
||||||
message StartMoneroNodeRequest {
|
message StartXmrNodeRequest {
|
||||||
MoneroNodeSettings settings = 1;
|
XmrNodeSettings settings = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message StartMoneroNodeReply {
|
message StartXmrNodeReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
message StopMoneroNodeRequest {
|
message StopXmrNodeRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message StopMoneroNodeReply {
|
message StopXmrNodeReply {
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1712,7 +1712,7 @@ message PreferencesPayload {
|
||||||
bool show_offers_matching_my_accounts = 55;
|
bool show_offers_matching_my_accounts = 55;
|
||||||
bool deny_api_taker = 56;
|
bool deny_api_taker = 56;
|
||||||
bool notify_on_pre_release = 57;
|
bool notify_on_pre_release = 57;
|
||||||
MoneroNodeSettings monero_node_settings = 58;
|
XmrNodeSettings xmr_node_settings = 58;
|
||||||
int32 clear_data_after_days = 59;
|
int32 clear_data_after_days = 59;
|
||||||
string buy_screen_crypto_currency_code = 60;
|
string buy_screen_crypto_currency_code = 60;
|
||||||
string sell_screen_crypto_currency_code = 61;
|
string sell_screen_crypto_currency_code = 61;
|
||||||
|
@ -1727,7 +1727,7 @@ message AutoConfirmSettings {
|
||||||
string currency_code = 5;
|
string currency_code = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MoneroNodeSettings {
|
message XmrNodeSettings {
|
||||||
string blockchain_path = 1;
|
string blockchain_path = 1;
|
||||||
string bootstrap_url = 2;
|
string bootstrap_url = 2;
|
||||||
repeated string startup_flags = 3;
|
repeated string startup_flags = 3;
|
||||||
|
|
Loading…
Reference in a new issue