replace LocalBitcoinNode with LocalMoneroNode
This commit is contained in:
parent
d50ab5782b
commit
740374c9db
@ -87,7 +87,7 @@ public class CoreApi {
|
||||
private final TradeStatisticsManager tradeStatisticsManager;
|
||||
private final CoreNotificationService notificationService;
|
||||
private final CoreMoneroConnectionsService coreMoneroConnectionsService;
|
||||
private final CoreMoneroNodeService coreMoneroNodeService;
|
||||
private final LocalMoneroNode coreMoneroNodeService;
|
||||
|
||||
@Inject
|
||||
public CoreApi(Config config,
|
||||
@ -104,7 +104,7 @@ public class CoreApi {
|
||||
TradeStatisticsManager tradeStatisticsManager,
|
||||
CoreNotificationService notificationService,
|
||||
CoreMoneroConnectionsService coreMoneroConnectionsService,
|
||||
CoreMoneroNodeService coreMoneroNodeService) {
|
||||
LocalMoneroNode coreMoneroNodeService) {
|
||||
this.config = config;
|
||||
this.appStartupState = appStartupState;
|
||||
this.coreAccountService = coreAccountService;
|
||||
@ -236,7 +236,7 @@ public class CoreApi {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public boolean isMoneroNodeOnline() {
|
||||
return coreMoneroNodeService.isOnline();
|
||||
return coreMoneroNodeService.isDetected();
|
||||
}
|
||||
|
||||
public MoneroNodeSettings getMoneroNodeSettings() {
|
||||
|
@ -57,7 +57,7 @@ public final class CoreMoneroConnectionsService {
|
||||
private final Preferences preferences;
|
||||
private final CoreAccountService accountService;
|
||||
private final XmrNodes xmrNodes;
|
||||
private final CoreMoneroNodeService nodeService;
|
||||
private final LocalMoneroNode nodeService;
|
||||
private final MoneroConnectionManager connectionManager;
|
||||
private final EncryptedConnectionList connectionList;
|
||||
private final ObjectProperty<List<MoneroPeer>> peers = new SimpleObjectProperty<>();
|
||||
@ -82,7 +82,7 @@ public final class CoreMoneroConnectionsService {
|
||||
WalletsSetup walletsSetup,
|
||||
CoreAccountService accountService,
|
||||
XmrNodes xmrNodes,
|
||||
CoreMoneroNodeService nodeService,
|
||||
LocalMoneroNode nodeService,
|
||||
MoneroConnectionManager connectionManager,
|
||||
EncryptedConnectionList connectionList,
|
||||
Socks5ProxyProvider socks5ProxyProvider) {
|
||||
@ -374,7 +374,7 @@ public final class CoreMoneroConnectionsService {
|
||||
if (!isInitialized) {
|
||||
|
||||
// register local node listener
|
||||
nodeService.addListener(new MoneroNodeServiceListener() {
|
||||
nodeService.addListener(new LocalMoneroNodeListener() {
|
||||
@Override
|
||||
public void onNodeStarted(MoneroDaemonRpc daemon) {
|
||||
log.info(getClass() + ".onNodeStarted() called");
|
||||
@ -481,7 +481,7 @@ public final class CoreMoneroConnectionsService {
|
||||
if (HavenoUtils.havenoSetup == null) return;
|
||||
|
||||
// start local node if offline and used as last connection
|
||||
if (connectionManager.getConnection() != null && nodeService.equalsUri(connectionManager.getConnection().getUri()) && !nodeService.isOnline()) {
|
||||
if (connectionManager.getConnection() != null && nodeService.equalsUri(connectionManager.getConnection().getUri()) && !nodeService.isDetected()) {
|
||||
try {
|
||||
log.info("Starting local node");
|
||||
nodeService.startMoneroNode();
|
||||
|
@ -25,7 +25,6 @@ import haveno.core.xmr.MoneroNodeSettings;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import monero.common.MoneroUtils;
|
||||
import monero.daemon.MoneroDaemonRpc;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
@ -38,15 +37,16 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@Singleton
|
||||
public class CoreMoneroNodeService {
|
||||
public class LocalMoneroNode {
|
||||
|
||||
public static final String MONEROD_DIR = Config.baseCurrencyNetwork() == BaseCurrencyNetwork.XMR_LOCAL ? System.getProperty("user.dir") + File.separator + ".localnet" : Config.appDataDir().getAbsolutePath();
|
||||
public static final String MONEROD_NAME = Utilities.isWindows() ? "monerod.exe" : "monerod";
|
||||
public static final String MONEROD_PATH = MONEROD_DIR + File.separator + MONEROD_NAME;
|
||||
private static final String MONEROD_DATADIR = Config.baseCurrencyNetwork() == BaseCurrencyNetwork.XMR_LOCAL ? MONEROD_DIR + File.separator + Config.baseCurrencyNetwork().toString().toLowerCase() + File.separator + "node1" : null; // use default directory unless local
|
||||
|
||||
private final Config config;
|
||||
private final Preferences preferences;
|
||||
private final List<MoneroNodeServiceListener> listeners = new ArrayList<>();
|
||||
private final List<LocalMoneroNodeListener> listeners = new ArrayList<>();
|
||||
|
||||
// required arguments
|
||||
private static final List<String> MONEROD_ARGS = new ArrayList<String>();
|
||||
@ -68,16 +68,34 @@ public class CoreMoneroNodeService {
|
||||
}
|
||||
|
||||
@Inject
|
||||
public CoreMoneroNodeService(Preferences preferences) {
|
||||
public LocalMoneroNode(Config config, Preferences preferences) {
|
||||
this.config = config;
|
||||
this.preferences = preferences;
|
||||
this.daemon = new MoneroDaemonRpc("http://" + HavenoUtils.LOOPBACK_HOST + ":" + rpcPort);
|
||||
}
|
||||
|
||||
public void addListener(MoneroNodeServiceListener listener) {
|
||||
/**
|
||||
* Returns whether Haveno should use a local Monero node, meaning that a node was
|
||||
* detected and conditions under which it should be ignored have not been met. If
|
||||
* the local node should be ignored, a call to this method will not trigger an
|
||||
* unnecessary detection attempt.
|
||||
*/
|
||||
public boolean shouldBeUsed() {
|
||||
return !shouldBeIgnored() && isDetected();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether Haveno should ignore a local Monero node even if it is usable.
|
||||
*/
|
||||
public boolean shouldBeIgnored() {
|
||||
return config.ignoreLocalXmrNode;
|
||||
}
|
||||
|
||||
public void addListener(LocalMoneroNodeListener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
public boolean removeListener(MoneroNodeServiceListener listener) {
|
||||
public boolean removeListener(LocalMoneroNodeListener listener) {
|
||||
return listeners.remove(listener);
|
||||
}
|
||||
|
||||
@ -97,9 +115,9 @@ public class CoreMoneroNodeService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if local Monero node is online.
|
||||
* Check if local Monero node is detected.
|
||||
*/
|
||||
public boolean isOnline() {
|
||||
public boolean isDetected() {
|
||||
checkConnection();
|
||||
return daemon.getRpcConnection().isOnline();
|
||||
}
|
||||
@ -129,7 +147,7 @@ public class CoreMoneroNodeService {
|
||||
* Persist the settings to preferences if the node started successfully.
|
||||
*/
|
||||
public void startMoneroNode(MoneroNodeSettings settings) throws IOException {
|
||||
if (isOnline()) 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);
|
||||
|
||||
@ -161,7 +179,7 @@ public class CoreMoneroNodeService {
|
||||
* Does not remove the last MoneroNodeSettings.
|
||||
*/
|
||||
public void stopMoneroNode() {
|
||||
if (!isOnline()) 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
|
||||
daemon.stopProcess();
|
||||
for (var listener : listeners) listener.onNodeStopped();
|
@ -18,7 +18,7 @@ package haveno.core.api;
|
||||
|
||||
import monero.daemon.MoneroDaemonRpc;
|
||||
|
||||
public class MoneroNodeServiceListener {
|
||||
public class LocalMoneroNodeListener {
|
||||
public void onNodeStarted(MoneroDaemonRpc daemon) {}
|
||||
public void onNodeStopped() {}
|
||||
}
|
@ -33,7 +33,7 @@ import haveno.core.alert.Alert;
|
||||
import haveno.core.alert.AlertManager;
|
||||
import haveno.core.alert.PrivateNotificationManager;
|
||||
import haveno.core.alert.PrivateNotificationPayload;
|
||||
import haveno.core.api.CoreMoneroNodeService;
|
||||
import haveno.core.api.LocalMoneroNode;
|
||||
import haveno.core.locale.Res;
|
||||
import haveno.core.offer.OpenOfferManager;
|
||||
import haveno.core.payment.AmazonGiftCardAccount;
|
||||
@ -52,7 +52,6 @@ import haveno.core.user.User;
|
||||
import haveno.core.util.FormattingUtils;
|
||||
import haveno.core.util.coin.CoinFormatter;
|
||||
import haveno.core.xmr.model.AddressEntry;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import haveno.core.xmr.setup.WalletsSetup;
|
||||
import haveno.core.xmr.wallet.BtcWalletService;
|
||||
import haveno.core.xmr.wallet.WalletsManager;
|
||||
@ -121,7 +120,7 @@ public class HavenoSetup {
|
||||
private final AccountAgeWitnessService accountAgeWitnessService;
|
||||
private final TorSetup torSetup;
|
||||
private final CoinFormatter formatter;
|
||||
private final LocalBitcoinNode localBitcoinNode;
|
||||
private final LocalMoneroNode localMoneroNode;
|
||||
private final AppStartupState appStartupState;
|
||||
private final MediationManager mediationManager;
|
||||
private final RefundManager refundManager;
|
||||
@ -215,7 +214,7 @@ public class HavenoSetup {
|
||||
AccountAgeWitnessService accountAgeWitnessService,
|
||||
TorSetup torSetup,
|
||||
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter,
|
||||
LocalBitcoinNode localBitcoinNode,
|
||||
LocalMoneroNode localMoneroNode,
|
||||
AppStartupState appStartupState,
|
||||
Socks5ProxyProvider socks5ProxyProvider,
|
||||
MediationManager mediationManager,
|
||||
@ -240,7 +239,7 @@ public class HavenoSetup {
|
||||
this.accountAgeWitnessService = accountAgeWitnessService;
|
||||
this.torSetup = torSetup;
|
||||
this.formatter = formatter;
|
||||
this.localBitcoinNode = localBitcoinNode;
|
||||
this.localMoneroNode = localMoneroNode;
|
||||
this.appStartupState = appStartupState;
|
||||
this.mediationManager = mediationManager;
|
||||
this.refundManager = refundManager;
|
||||
@ -339,12 +338,12 @@ public class HavenoSetup {
|
||||
|
||||
private void maybeInstallDependencies() {
|
||||
try {
|
||||
File monerodFile = new File(CoreMoneroNodeService.MONEROD_PATH);
|
||||
String monerodResourcePath = "bin/" + CoreMoneroNodeService.MONEROD_NAME;
|
||||
File monerodFile = new File(LocalMoneroNode.MONEROD_PATH);
|
||||
String monerodResourcePath = "bin/" + LocalMoneroNode.MONEROD_NAME;
|
||||
if (!monerodFile.exists() || !FileUtil.resourceEqualToFile(monerodResourcePath, monerodFile)) {
|
||||
log.info("Installing monerod");
|
||||
monerodFile.getParentFile().mkdirs();
|
||||
FileUtil.resourceToFile("bin/" + CoreMoneroNodeService.MONEROD_NAME, monerodFile);
|
||||
FileUtil.resourceToFile("bin/" + LocalMoneroNode.MONEROD_NAME, monerodFile);
|
||||
monerodFile.setExecutable(true);
|
||||
}
|
||||
|
||||
@ -621,7 +620,7 @@ public class HavenoSetup {
|
||||
}
|
||||
|
||||
private void maybeShowLocalhostRunningInfo() {
|
||||
maybeTriggerDisplayHandler("bitcoinLocalhostNode", displayLocalhostHandler, localBitcoinNode.shouldBeUsed());
|
||||
maybeTriggerDisplayHandler("moneroLocalhostNode", displayLocalhostHandler, localMoneroNode.shouldBeUsed());
|
||||
}
|
||||
|
||||
private void maybeShowAccountSigningStateInfo() {
|
||||
|
@ -33,7 +33,6 @@ import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.PaymentAccountUtil;
|
||||
import haveno.core.xmr.MoneroNodeSettings;
|
||||
import haveno.core.xmr.nodes.XmrNodes;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import haveno.core.xmr.wallet.Restrictions;
|
||||
import haveno.network.p2p.network.BridgeAddressProvider;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
@ -153,7 +152,6 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
|
||||
private final PersistenceManager<PreferencesPayload> persistenceManager;
|
||||
private final Config config;
|
||||
private final LocalBitcoinNode localBitcoinNode;
|
||||
private final String xmrNodesFromOptions;
|
||||
@Getter
|
||||
private final BooleanProperty useStandbyModeProperty = new SimpleBooleanProperty(prefPayload.isUseStandbyMode());
|
||||
@ -165,12 +163,10 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
|
||||
@Inject
|
||||
public Preferences(PersistenceManager<PreferencesPayload> persistenceManager,
|
||||
Config config,
|
||||
LocalBitcoinNode localBitcoinNode,
|
||||
@Named(Config.XMR_NODES) String xmrNodesFromOptions) {
|
||||
|
||||
this.persistenceManager = persistenceManager;
|
||||
this.config = config;
|
||||
this.localBitcoinNode = localBitcoinNode;
|
||||
this.xmrNodesFromOptions = xmrNodesFromOptions;
|
||||
|
||||
useAnimationsProperty.addListener((ov) -> {
|
||||
|
@ -1,85 +0,0 @@
|
||||
package haveno.core.xmr.nodes;
|
||||
|
||||
import haveno.common.config.BaseCurrencyNetwork;
|
||||
import haveno.common.config.Config;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
|
||||
/**
|
||||
* Detects whether a Bitcoin node is running on localhost and contains logic for when to
|
||||
* ignore it. The query methods lazily trigger the needed checks and cache the results.
|
||||
* @see haveno.common.config.Config#ignoreLocalXmrNode
|
||||
*/
|
||||
@Singleton
|
||||
public class LocalBitcoinNode {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LocalBitcoinNode.class);
|
||||
private static final int CONNECTION_TIMEOUT = 5000;
|
||||
|
||||
private final Config config;
|
||||
private final int port;
|
||||
|
||||
private Boolean detected;
|
||||
|
||||
@Inject
|
||||
public LocalBitcoinNode(Config config) {
|
||||
this.config = config;
|
||||
this.port = config.networkParameters.getPort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether Haveno should use a local Bitcoin node, meaning that a node was
|
||||
* detected and conditions under which it should be ignored have not been met. If
|
||||
* the local node should be ignored, a call to this method will not trigger an
|
||||
* unnecessary detection attempt.
|
||||
*/
|
||||
public boolean shouldBeUsed() {
|
||||
return !shouldBeIgnored() && isDetected();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether Haveno should ignore a local Bitcoin node even if it is usable.
|
||||
*/
|
||||
public boolean shouldBeIgnored() {
|
||||
BaseCurrencyNetwork baseCurrencyNetwork = config.baseCurrencyNetwork;
|
||||
return config.ignoreLocalXmrNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether a local Bitcoin node was detected. The check is triggered in case
|
||||
* it has not been performed. No further monitoring is performed, so if the node
|
||||
* goes up or down in the meantime, this method will continue to return its original
|
||||
* value. See {@code MainViewModel#setupBtcNumPeersWatcher} to understand how
|
||||
* disconnection and reconnection of the local Bitcoin node is actually handled.
|
||||
*/
|
||||
private boolean isDetected() {
|
||||
if (detected == null) {
|
||||
detected = detect(port);
|
||||
}
|
||||
return detected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect whether a Bitcoin node is running on localhost by attempting to connect
|
||||
* to the node's port.
|
||||
*/
|
||||
private static boolean detect(int port) {
|
||||
try (Socket socket = new Socket()) {
|
||||
var address = new InetSocketAddress(InetAddress.getLoopbackAddress(), port);
|
||||
socket.connect(address, CONNECTION_TIMEOUT);
|
||||
log.info("Local Bitcoin node detected on port {}", port);
|
||||
return true;
|
||||
} catch (IOException ex) {
|
||||
log.info("No local Bitcoin node detected on port {}.", port);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -22,7 +22,7 @@ import com.google.common.util.concurrent.AbstractIdleService;
|
||||
import com.runjva.sourceforge.jsocks.protocol.Socks5Proxy;
|
||||
import haveno.common.config.Config;
|
||||
import haveno.common.file.FileUtil;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import haveno.core.api.LocalMoneroNode;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import lombok.Getter;
|
||||
@ -103,7 +103,7 @@ public class WalletConfig extends AbstractIdleService {
|
||||
protected volatile Context context;
|
||||
|
||||
protected Config config;
|
||||
protected LocalBitcoinNode localBitcoinNode;
|
||||
protected LocalMoneroNode localMoneroNode;
|
||||
protected Socks5Proxy socks5Proxy;
|
||||
protected int numConnectionsForBtc;
|
||||
@Getter
|
||||
@ -143,9 +143,9 @@ public class WalletConfig extends AbstractIdleService {
|
||||
return this;
|
||||
}
|
||||
|
||||
public WalletConfig setLocalBitcoinNode(LocalBitcoinNode localBitcoinNode) {
|
||||
public WalletConfig setLocalMoneroNodeService(LocalMoneroNode localMoneroNode) {
|
||||
checkState(state() == State.NEW, "Cannot call after startup");
|
||||
this.localBitcoinNode = localBitcoinNode;
|
||||
this.localMoneroNode = localMoneroNode;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ import haveno.common.config.Config;
|
||||
import haveno.common.file.FileUtil;
|
||||
import haveno.common.handlers.ExceptionHandler;
|
||||
import haveno.common.handlers.ResultHandler;
|
||||
import haveno.core.api.LocalMoneroNode;
|
||||
import haveno.core.user.Preferences;
|
||||
import haveno.core.xmr.exceptions.InvalidHostException;
|
||||
import haveno.core.xmr.model.AddressEntry;
|
||||
@ -38,7 +39,6 @@ import haveno.core.xmr.nodes.XmrNodes;
|
||||
import haveno.core.xmr.nodes.XmrNodes.XmrNode;
|
||||
import haveno.core.xmr.nodes.XmrNodesRepository;
|
||||
import haveno.core.xmr.nodes.XmrNodesSetupPreferences;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import haveno.network.Socks5MultiDiscovery;
|
||||
import haveno.network.Socks5ProxyProvider;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
@ -100,7 +100,7 @@ public class WalletsSetup {
|
||||
private final Preferences preferences;
|
||||
private final Socks5ProxyProvider socks5ProxyProvider;
|
||||
private final Config config;
|
||||
private final LocalBitcoinNode localBitcoinNode;
|
||||
private final LocalMoneroNode localMoneroNode;
|
||||
private final XmrNodes xmrNodes;
|
||||
private final int numConnectionsForBtc;
|
||||
private final String userAgent;
|
||||
@ -126,7 +126,7 @@ public class WalletsSetup {
|
||||
Preferences preferences,
|
||||
Socks5ProxyProvider socks5ProxyProvider,
|
||||
Config config,
|
||||
LocalBitcoinNode localBitcoinNode,
|
||||
LocalMoneroNode localMoneroNode,
|
||||
XmrNodes xmrNodes,
|
||||
@Named(Config.USER_AGENT) String userAgent,
|
||||
@Named(Config.WALLET_DIR) File walletDir,
|
||||
@ -138,7 +138,7 @@ public class WalletsSetup {
|
||||
this.preferences = preferences;
|
||||
this.socks5ProxyProvider = socks5ProxyProvider;
|
||||
this.config = config;
|
||||
this.localBitcoinNode = localBitcoinNode;
|
||||
this.localMoneroNode = localMoneroNode;
|
||||
this.xmrNodes = xmrNodes;
|
||||
this.numConnectionsForBtc = numConnectionsForBtc;
|
||||
this.useAllProvidedNodes = useAllProvidedNodes;
|
||||
@ -195,7 +195,7 @@ public class WalletsSetup {
|
||||
};
|
||||
walletConfig.setSocks5Proxy(socks5Proxy);
|
||||
walletConfig.setConfig(config);
|
||||
walletConfig.setLocalBitcoinNode(localBitcoinNode); // TODO: adapt to xmr or remove
|
||||
walletConfig.setLocalMoneroNodeService(localMoneroNode); // TODO: adapt to xmr or remove
|
||||
walletConfig.setUserAgent(userAgent, Version.VERSION);
|
||||
walletConfig.setNumConnectionsForBtc(numConnectionsForBtc);
|
||||
|
||||
@ -230,7 +230,7 @@ public class WalletsSetup {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (localBitcoinNode.shouldBeUsed()) {
|
||||
} else if (localMoneroNode.shouldBeUsed()) {
|
||||
walletConfig.setMinBroadcastConnections(1);
|
||||
walletConfig.connectToLocalHost();
|
||||
} else {
|
||||
|
@ -2179,7 +2179,7 @@ popup.warn.daoRequiresRestart=There was a problem with synchronizing the DAO sta
|
||||
|
||||
popup.privateNotification.headline=Important private notification!
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Monero node running on this machine (at localhost).\n\n\
|
||||
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\n\
|
||||
|
||||
popup.shutDownInProgress.headline=Shut down in progress
|
||||
|
@ -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.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ší bitcoinové 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.bitcoinLocalhostNode.msg=Haveno detekoval Bitcoin Core node běžící na tomto systému (na localhostu).\n\nProsím ujistěte se, že:\n- tento node je plně synchronizován před spuštěním Haveno\n- prořezávání je vypnuto ('prune=0' v bitcoin.conf)\n- Bloomovy filtry jsou zapnuty ('peerbloomfilters=1' v bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detekoval Bitcoin Core node běžící na tomto systému (na localhostu).\n\nProsím ujistěte se, že:\n- tento node je plně synchronizován před spuštěním Haveno\n- prořezávání je vypnuto ('prune=0' v bitcoin.conf)\n- Bloomovy filtry jsou zapnuty ('peerbloomfilters=1' v bitcoin.conf)
|
||||
|
||||
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.
|
||||
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=Wichtige private Benachrichtigung!
|
||||
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 Bitcoin-Wallet.\nIm \"Wallet-Seed\"-Abschnitt finden Sie weitere Informationen.\n\nZusätzlich sollten Sie ein Backup des ganzen Anwendungsdatenordners im \"Backup\"-Abschnitt erstellen.
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno hat einen Bitcoin Core Node entdeckt, der auf diesem Rechner (auf localhost) läuft.\n\nBitte stellen Sie sicher dass:\n- der Node vollständig synchronisiert ist, bevor Sie Haveno starten\n- Pruning deaktiviert ist ('prune=0' in bitcoin.conf)\n- Bloom-Filter aktiviert sind ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno hat einen Bitcoin Core Node entdeckt, der auf diesem Rechner (auf localhost) läuft.\n\nBitte stellen Sie sicher dass:\n- der Node vollständig synchronisiert ist, bevor Sie Haveno starten\n- Pruning deaktiviert ist ('prune=0' in bitcoin.conf)\n- Bloom-Filter aktiviert sind ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Anwendung wird heruntergefahren
|
||||
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.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 Bitcoin.\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.bitcoinLocalhostNode.msg=Haveno ha detectado un nodo de Bitcoin Core ejecutándose en esta máquina (en local).\n\nPor favor, asegúrese de:\n- que el nodo está completamente sincronizado al iniciar Haveno\n- que el podado está desabilitado ('prune=0' en bitcoin.conf)\n- que los filtros bloom están deshabilitados ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno ha detectado un nodo de Bitcoin Core ejecutándose en esta máquina (en local).\n\nPor favor, asegúrese de:\n- que el nodo está completamente sincronizado al iniciar Haveno\n- que el podado está desabilitado ('prune=0' en bitcoin.conf)\n- que los filtros bloom están deshabilitados ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Cerrando aplicación...
|
||||
popup.shutDownInProgress.msg=Cerrar la aplicación puede llevar unos segundos.\nPor favor no interrumpa el proceso.
|
||||
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=اعلان خصوصی مهم!
|
||||
popup.securityRecommendation.headline=توصیه امنیتی مهم
|
||||
popup.securityRecommendation.msg=ما می خواهیم به شما یادآوری کنیم که استفاده از رمز محافظت برای کیف پول خود را در نظر بگیرید اگر از قبل آن را فعال نکرده اید.\n\nهمچنین شدیداً توصیه می شود که کلمات رمز خصوصی کیف پول را بنویسید. این کلمات رمز خصوصی مانند یک رمزعبور اصلی برای بازیابی کیف پول بیتکوین شما هستند. \nدر قسمت \"کلمات رمز خصوصی کیف پول\" اطلاعات بیشتری کسب می کنید.\n\n علاوه بر این شما باید از پوشه داده های کامل نرم افزار در بخش \"پشتیبان گیری\" پشتیبان تهیه کنید.
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=خاموش شدن در حال انجام است
|
||||
popup.shutDownInProgress.msg=خاتمه دادن به برنامه می تواند چند ثانیه طول بکشد.\n لطفا این روند را قطع نکنید.
|
||||
|
@ -1625,7 +1625,7 @@ popup.privateNotification.headline=Notification privée 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 Bitcoin.\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.bitcoinLocalhostNode.msg=Haveno a détecté un noeud Bitcoin Core en cours d'exécution sur cette machine (sur l'ĥote local)\n\nVeuillez vous assurer que:\n- le noeud est complètement synchronisé avant de lancer Haveno\n- l'élagage est désactivé ('prune=0' dans bitcoin.conf)\n- les filtres de Bloom sont activés ('peerbloomfilters=1' dans bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno a détecté un noeud Bitcoin Core en cours d'exécution sur cette machine (sur l'ĥote local)\n\nVeuillez vous assurer que:\n- le noeud est complètement synchronisé avant de lancer Haveno\n- l'élagage est désactivé ('prune=0' dans bitcoin.conf)\n- les filtres de Bloom sont activés ('peerbloomfilters=1' dans bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Fermeture en cours
|
||||
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=Notifica privata importante!
|
||||
popup.securityRecommendation.headline=Raccomandazione di sicurezza importante
|
||||
popup.securityRecommendation.msg=Vorremmo ricordarti di prendere in considerazione l'utilizzo della protezione con password per il tuo portafoglio se non l'avessi già abilitato.\n\nSi consiglia inoltre di annotare le parole seme del portafoglio. Le parole seme sono come una password principale per recuperare il tuo portafoglio Bitcoin.\nNella sezione \"Wallet Seed\" trovi ulteriori informazioni.\n\nInoltre, è necessario eseguire il backup della cartella completa dei dati dell'applicazione nella sezione \"Backup\".
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Arresto in corso
|
||||
popup.shutDownInProgress.msg=La chiusura dell'applicazione può richiedere un paio di secondi.\nNon interrompere il processo.
|
||||
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=重要なプライベート通知!
|
||||
popup.securityRecommendation.headline=重要なセキュリティ勧告
|
||||
popup.securityRecommendation.msg=ウォレットのパスワード保護をまだ有効にしてない場合は、使用することを検討してください。\n\nウォレットシードワードを書き留めることも強くお勧めします。 これらのシードワードは、あなたのビットコインウォレットを復元するためのマスターパスワードのようなものです。\n「ウォレットシード」セクションにてより詳細な情報を確認できます。\n\nまた、「バックアップ」セクションのアプリケーションデータフォルダ全体をバックアップするべきでしょう。
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Havenoはローカルで動作するビットコインコアノード(ローカルホストに)を検出しました。\n\n以下の点を確認して下さい:\n- Havenoを起動する前にノードは完全に同期されていること\n- プルーニングモードは無効にされること(bitcoin.confに'prune=0')\n- ブルームフィルターは有効にされること(bitcoin.confに'peerbloomfilters=1')
|
||||
popup.moneroLocalhostNode.msg=Havenoはローカルで動作するビットコインコアノード(ローカルホストに)を検出しました。\n\n以下の点を確認して下さい:\n- Havenoを起動する前にノードは完全に同期されていること\n- プルーニングモードは無効にされること(bitcoin.confに'prune=0')\n- ブルームフィルターは有効にされること(bitcoin.confに'peerbloomfilters=1')
|
||||
|
||||
popup.shutDownInProgress.headline=シャットダウン中
|
||||
popup.shutDownInProgress.msg=アプリケーションのシャットダウンには数秒かかることがあります。\nこのプロセスを中断しないでください。
|
||||
|
@ -1632,7 +1632,7 @@ popup.privateNotification.headline=Notificação privada importante!
|
||||
popup.securityRecommendation.headline=Recomendação de segurança importante
|
||||
popup.securityRecommendation.msg=Lembre-se de proteger a sua carteira com uma senha, caso você já não tenha criado uma.\n\nRecomendamos que você escreva num papel as palavras da semente de sua carteira. Essas palavras funcionam como uma senha mestra para recuperar a sua carteira Bitcoin, caso o seu computador apresente algum problema.\nVocê irá encontrar mais informações na seção \"Semente da carteira\".\n\nTambém aconselhamos que você faça um backup completo da pasta de dados do programa na seção \"Backup\".
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Desligando
|
||||
popup.shutDownInProgress.msg=O desligamento do programa pode levar alguns segundos.\nPor favor, não interrompa este processo.
|
||||
|
@ -1622,7 +1622,7 @@ popup.privateNotification.headline=Notificação privada importante!
|
||||
popup.securityRecommendation.headline=Recomendação de segurança importante
|
||||
popup.securityRecommendation.msg=Gostaríamos de lembrá-lo de considerar a possibilidade de usar a proteção por senha para sua carteira, caso você ainda não tenha ativado isso.\n\nTambém é altamente recomendável anotar as palavras-semente da carteira. Essas palavras-semente são como uma senha mestre para recuperar sua carteira Bitcoin.\nNa secção \"Semente da Carteira\", você encontrará mais informações.\n\nAlém disso, você deve fazer o backup da pasta completa de dados do programa na secção \"Backup\".
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Desligando
|
||||
popup.shutDownInProgress.msg=Desligar o programa pode demorar alguns segundos.\nPor favor não interrompa este processo.
|
||||
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=Важное личное уведомлен
|
||||
popup.securityRecommendation.headline=Важная рекомендация по безопасности
|
||||
popup.securityRecommendation.msg=Рекомендуем вам защитить свой кошелёк паролем, если вы ещё этого не сделали.\n\nТакже убедительно рекомендуем записать вашу мнемоническую фразу. Она поможет восстановить ваш кошелёк Биткойн.\nДополнительная информация указана в разделе \«Мнемоническая фраза\».\n\nВам также следует сохранить копию папки со всеми данными программы в разделе \«Резервное копирование\».
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Завершение работы
|
||||
popup.shutDownInProgress.msg=Завершение работы приложения может занять несколько секунд.\nПросьба не прерывать этот процесс.
|
||||
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=การแจ้งเตือนส่ว
|
||||
popup.securityRecommendation.headline=ข้อเสนอแนะด้านความปลอดภัยที่สำคัญ
|
||||
popup.securityRecommendation.msg=เราขอแจ้งเตือนให้คุณพิจารณาใช้การป้องกันด้วยรหัสผ่านสำหรับ wallet ของคุณ หากยังไม่ได้เปิดใช้งาน\n\nขอแนะนำให้เขียนรหัสลับป้องกัน wallet รหัสลับเหล่านี้เหมือนกับรหัสผ่านหลักสำหรับการกู้คืน Bitcoin wallet ของคุณ\nไปที่ \"กระเป๋าสตางค์ \" คุณจะพบข้อมูลเพิ่มเติม\n\nนอกจากนี้คุณควรสำรองโฟลเดอร์ข้อมูลแอ็พพลิเคชั่นทั้งหมดไว้ที่ส่วน \"สำรองข้อมูล \"
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=การปิดระบบอยู่ระหว่างดำเนินการ
|
||||
popup.shutDownInProgress.msg=การปิดแอพพลิเคชั่นอาจใช้เวลาสักครู่\nโปรดอย่าขัดจังหวะกระบวนการนี้
|
||||
|
@ -1626,7 +1626,7 @@ popup.privateNotification.headline=Thông báo riêng tư quan trọng!
|
||||
popup.securityRecommendation.headline=Khuyến cáo an ninh quan trọng
|
||||
popup.securityRecommendation.msg=Chúng tôi muốn nhắc nhở bạn sử dụng bảo vệ bằng mật khẩu cho ví của bạn nếu bạn vẫn chưa sử dụng.\n\nChúng tôi cũng khuyên bạn nên viết Seed words ví của bạn ra giấy. Các Seed words này như là mật khẩu chủ để khôi phục ví Bitcoin của bạn.\nBạn có thể xem thông tin ở mục \"Wallet Seed\".\n\nNgoài ra bạn nên sao lưu dự phòng folder dữ liệu ứng dụng đầy đủ ở mục \"Backup\".
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=Đang tắt ứng dụng
|
||||
popup.shutDownInProgress.msg=Tắt ứng dụng sẽ mất vài giây.\nVui lòng không gián đoạn quá trình này.
|
||||
|
@ -1628,7 +1628,7 @@ popup.privateNotification.headline=重要私人通知!
|
||||
popup.securityRecommendation.headline=重要安全建议
|
||||
popup.securityRecommendation.msg=如果您还没有启用,我们想提醒您考虑为您的钱包使用密码保护。\n\n强烈建议你写下钱包还原密钥。 那些还原密钥就是恢复你的比特币钱包的主密码。\n在“钱包密钥”部分,您可以找到更多信息\n\n此外,您应该在“备份”界面备份完整的应用程序数据文件夹。
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno 侦测到一个比特币核心节点在本机(本地)运行\n\n请确保:\n- 这个节点已经在运行 Haveno 之前已全部同步\n- 修饰已被禁用 ('prune=0' 在 bitcoin.conf 文件中)\n- Bloom 过滤器已经启用('peerbloomfilters=1' 在 bitcoin.conf 文件中)
|
||||
popup.moneroLocalhostNode.msg=Haveno 侦测到一个比特币核心节点在本机(本地)运行\n\n请确保:\n- 这个节点已经在运行 Haveno 之前已全部同步\n- 修饰已被禁用 ('prune=0' 在 bitcoin.conf 文件中)\n- Bloom 过滤器已经启用('peerbloomfilters=1' 在 bitcoin.conf 文件中)
|
||||
|
||||
popup.shutDownInProgress.headline=正在关闭
|
||||
popup.shutDownInProgress.msg=关闭应用可能会花一点时间。\n请不要打断关闭过程。
|
||||
|
@ -1624,7 +1624,7 @@ popup.privateNotification.headline=重要私人通知!
|
||||
popup.securityRecommendation.headline=重要安全建議
|
||||
popup.securityRecommendation.msg=如果您還沒有啟用,我們想提醒您考慮為您的錢包使用密碼保護。\n\n強烈建議你寫下錢包還原密鑰。 那些還原密鑰就是恢復你的比特幣錢包的主密碼。\n在“錢包密鑰”部分,您可以找到更多信息\n\n此外,您應該在“備份”界面備份完整的應用程序數據文件夾。
|
||||
|
||||
popup.bitcoinLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
popup.moneroLocalhostNode.msg=Haveno detected a Bitcoin Core node running on this machine (at localhost).\n\nPlease ensure:\n- the node is fully synced before starting Haveno\n- pruning is disabled ('prune=0' in bitcoin.conf)\n- bloom filters are enabled ('peerbloomfilters=1' in bitcoin.conf)
|
||||
|
||||
popup.shutDownInProgress.headline=正在關閉
|
||||
popup.shutDownInProgress.msg=關閉應用可能會花一點時間。\n請不要打斷關閉過程。
|
||||
|
@ -19,13 +19,13 @@ package haveno.core.user;
|
||||
|
||||
import haveno.common.config.Config;
|
||||
import haveno.common.persistence.PersistenceManager;
|
||||
import haveno.core.api.LocalMoneroNode;
|
||||
import haveno.core.locale.CountryUtil;
|
||||
import haveno.core.locale.CryptoCurrency;
|
||||
import haveno.core.locale.CurrencyUtil;
|
||||
import haveno.core.locale.TraditionalCurrency;
|
||||
import haveno.core.locale.GlobalSettings;
|
||||
import haveno.core.locale.Res;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import javafx.collections.ObservableList;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -56,9 +56,9 @@ public class PreferencesTest {
|
||||
|
||||
persistenceManager = mock(PersistenceManager.class);
|
||||
Config config = new Config();
|
||||
LocalBitcoinNode localBitcoinNode = new LocalBitcoinNode(config);
|
||||
LocalMoneroNode localMoneroNode = new LocalMoneroNode(config, preferences);
|
||||
preferences = new Preferences(
|
||||
persistenceManager, config, localBitcoinNode, null);
|
||||
persistenceManager, config, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -48,7 +48,6 @@ import haveno.core.trade.TradeManager;
|
||||
import haveno.core.user.DontShowAgainLookup;
|
||||
import haveno.core.user.Preferences;
|
||||
import haveno.core.user.User;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import haveno.core.xmr.wallet.XmrWalletService;
|
||||
import haveno.desktop.Navigation;
|
||||
import haveno.desktop.common.model.ViewModel;
|
||||
@ -122,7 +121,6 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||
@Getter
|
||||
private final PriceFeedService priceFeedService;
|
||||
private final Config config;
|
||||
private final LocalBitcoinNode localBitcoinNode;
|
||||
private final AccountAgeWitnessService accountAgeWitnessService;
|
||||
@Getter
|
||||
private final TorNetworkSettingsWindow torNetworkSettingsWindow;
|
||||
@ -166,7 +164,6 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||
TacWindow tacWindow,
|
||||
PriceFeedService priceFeedService,
|
||||
Config config,
|
||||
LocalBitcoinNode localBitcoinNode,
|
||||
AccountAgeWitnessService accountAgeWitnessService,
|
||||
TorNetworkSettingsWindow torNetworkSettingsWindow,
|
||||
CorruptedStorageFileHandler corruptedStorageFileHandler,
|
||||
@ -190,7 +187,6 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||
this.tacWindow = tacWindow;
|
||||
this.priceFeedService = priceFeedService;
|
||||
this.config = config;
|
||||
this.localBitcoinNode = localBitcoinNode;
|
||||
this.accountAgeWitnessService = accountAgeWitnessService;
|
||||
this.torNetworkSettingsWindow = torNetworkSettingsWindow;
|
||||
this.corruptedStorageFileHandler = corruptedStorageFileHandler;
|
||||
@ -359,7 +355,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
||||
havenoSetup.setDisplaySecurityRecommendationHandler(key -> {});
|
||||
havenoSetup.setDisplayLocalhostHandler(key -> {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
Popup popup = new Popup().backgroundInfo(Res.get("popup.bitcoinLocalhostNode.msg"))
|
||||
Popup popup = new Popup().backgroundInfo(Res.get("popup.moneroLocalhostNode.msg"))
|
||||
.dontShowAgainId(key);
|
||||
popup.setDisplayOrderPriority(5);
|
||||
popupQueue.add(popup);
|
||||
|
@ -20,6 +20,7 @@ package haveno.desktop.main.settings.network;
|
||||
import haveno.common.ClockWatcher;
|
||||
import haveno.common.UserThread;
|
||||
import haveno.core.api.CoreMoneroConnectionsService;
|
||||
import haveno.core.api.LocalMoneroNode;
|
||||
import haveno.core.filter.Filter;
|
||||
import haveno.core.filter.FilterManager;
|
||||
import haveno.core.locale.Res;
|
||||
@ -28,7 +29,6 @@ import haveno.core.util.FormattingUtils;
|
||||
import haveno.core.util.validation.RegexValidator;
|
||||
import haveno.core.util.validation.RegexValidatorFactory;
|
||||
import haveno.core.xmr.nodes.XmrNodes;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
import haveno.core.xmr.setup.WalletsSetup;
|
||||
import haveno.desktop.app.HavenoApp;
|
||||
import haveno.desktop.common.view.ActivatableView;
|
||||
@ -104,7 +104,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
private final Preferences preferences;
|
||||
private final XmrNodes xmrNodes;
|
||||
private final FilterManager filterManager;
|
||||
private final LocalBitcoinNode localBitcoinNode;
|
||||
private final LocalMoneroNode localMoneroNode;
|
||||
private final TorNetworkSettingsWindow torNetworkSettingsWindow;
|
||||
private final ClockWatcher clockWatcher;
|
||||
private final WalletsSetup walletsSetup;
|
||||
@ -134,7 +134,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
Preferences preferences,
|
||||
XmrNodes xmrNodes,
|
||||
FilterManager filterManager,
|
||||
LocalBitcoinNode localBitcoinNode,
|
||||
LocalMoneroNode localMoneroNode,
|
||||
TorNetworkSettingsWindow torNetworkSettingsWindow,
|
||||
ClockWatcher clockWatcher) {
|
||||
super();
|
||||
@ -144,7 +144,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
this.preferences = preferences;
|
||||
this.xmrNodes = xmrNodes;
|
||||
this.filterManager = filterManager;
|
||||
this.localBitcoinNode = localBitcoinNode;
|
||||
this.localMoneroNode = localMoneroNode;
|
||||
this.torNetworkSettingsWindow = torNetworkSettingsWindow;
|
||||
this.clockWatcher = clockWatcher;
|
||||
}
|
||||
@ -385,16 +385,16 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
}
|
||||
|
||||
private void onMoneroPeersToggleSelected(boolean calledFromUser) {
|
||||
boolean localBitcoinNodeShouldBeUsed = localBitcoinNode.shouldBeUsed();
|
||||
useTorForXmrJCheckBox.setDisable(localBitcoinNodeShouldBeUsed);
|
||||
moneroNodesLabel.setDisable(localBitcoinNodeShouldBeUsed);
|
||||
xmrNodesLabel.setDisable(localBitcoinNodeShouldBeUsed);
|
||||
xmrNodesInputTextField.setDisable(localBitcoinNodeShouldBeUsed);
|
||||
useProvidedNodesRadio.setDisable(localBitcoinNodeShouldBeUsed);
|
||||
useCustomNodesRadio.setDisable(localBitcoinNodeShouldBeUsed);
|
||||
usePublicNodesRadio.setDisable(localBitcoinNodeShouldBeUsed || isPreventPublicXmrNetwork());
|
||||
boolean localMoneroNodeShouldBeUsed = localMoneroNode.shouldBeUsed();
|
||||
useTorForXmrJCheckBox.setDisable(localMoneroNodeShouldBeUsed);
|
||||
moneroNodesLabel.setDisable(localMoneroNodeShouldBeUsed);
|
||||
xmrNodesLabel.setDisable(localMoneroNodeShouldBeUsed);
|
||||
xmrNodesInputTextField.setDisable(localMoneroNodeShouldBeUsed);
|
||||
useProvidedNodesRadio.setDisable(localMoneroNodeShouldBeUsed);
|
||||
useCustomNodesRadio.setDisable(localMoneroNodeShouldBeUsed);
|
||||
usePublicNodesRadio.setDisable(localMoneroNodeShouldBeUsed || isPreventPublicXmrNetwork());
|
||||
|
||||
XmrNodes.MoneroNodesOption currentBitcoinNodesOption = XmrNodes.MoneroNodesOption.values()[preferences.getMoneroNodesOptionOrdinal()];
|
||||
XmrNodes.MoneroNodesOption currentMoneroNodesOption = XmrNodes.MoneroNodesOption.values()[preferences.getMoneroNodesOptionOrdinal()];
|
||||
|
||||
switch (selectedMoneroNodesOption) {
|
||||
case CUSTOM:
|
||||
@ -402,7 +402,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
xmrNodesLabel.setDisable(false);
|
||||
if (!xmrNodesInputTextField.getText().isEmpty()
|
||||
&& xmrNodesInputTextField.validate()
|
||||
&& currentBitcoinNodesOption != XmrNodes.MoneroNodesOption.CUSTOM) {
|
||||
&& currentMoneroNodesOption != XmrNodes.MoneroNodesOption.CUSTOM) {
|
||||
preferences.setMoneroNodesOptionOrdinal(selectedMoneroNodesOption.ordinal());
|
||||
if (calledFromUser) {
|
||||
if (isPreventPublicXmrNetwork()) {
|
||||
@ -417,7 +417,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
case PUBLIC:
|
||||
xmrNodesInputTextField.setDisable(true);
|
||||
xmrNodesLabel.setDisable(true);
|
||||
if (currentBitcoinNodesOption != XmrNodes.MoneroNodesOption.PUBLIC) {
|
||||
if (currentMoneroNodesOption != XmrNodes.MoneroNodesOption.PUBLIC) {
|
||||
preferences.setMoneroNodesOptionOrdinal(selectedMoneroNodesOption.ordinal());
|
||||
if (calledFromUser) {
|
||||
new Popup()
|
||||
@ -439,7 +439,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
case PROVIDED:
|
||||
xmrNodesInputTextField.setDisable(true);
|
||||
xmrNodesLabel.setDisable(true);
|
||||
if (currentBitcoinNodesOption != XmrNodes.MoneroNodesOption.PROVIDED) {
|
||||
if (currentMoneroNodesOption != XmrNodes.MoneroNodesOption.PROVIDED) {
|
||||
preferences.setMoneroNodesOptionOrdinal(selectedMoneroNodesOption.ordinal());
|
||||
if (calledFromUser) {
|
||||
showShutDownPopup();
|
||||
@ -452,7 +452,7 @@ public class NetworkSettingsView extends ActivatableView<GridPane, Void> {
|
||||
|
||||
private void applyPreventPublicXmrNetwork() {
|
||||
final boolean preventPublicXmrNetwork = isPreventPublicXmrNetwork();
|
||||
usePublicNodesRadio.setDisable(localBitcoinNode.shouldBeUsed() || preventPublicXmrNetwork);
|
||||
usePublicNodesRadio.setDisable(localMoneroNode.shouldBeUsed() || preventPublicXmrNetwork);
|
||||
if (preventPublicXmrNetwork && selectedMoneroNodesOption == XmrNodes.MoneroNodesOption.PUBLIC) {
|
||||
selectedMoneroNodesOption = XmrNodes.MoneroNodesOption.PROVIDED;
|
||||
preferences.setMoneroNodesOptionOrdinal(selectedMoneroNodesOption.ordinal());
|
||||
|
@ -22,8 +22,8 @@ import com.natpryce.makeiteasy.Property;
|
||||
import com.natpryce.makeiteasy.SameValueDonor;
|
||||
import haveno.common.config.Config;
|
||||
import haveno.common.persistence.PersistenceManager;
|
||||
import haveno.core.api.LocalMoneroNode;
|
||||
import haveno.core.user.Preferences;
|
||||
import haveno.core.xmr.nodes.LocalBitcoinNode;
|
||||
|
||||
import static com.natpryce.makeiteasy.MakeItEasy.a;
|
||||
import static com.natpryce.makeiteasy.MakeItEasy.make;
|
||||
@ -32,14 +32,13 @@ public class PreferenceMakers {
|
||||
|
||||
public static final Property<Preferences, PersistenceManager> storage = new Property<>();
|
||||
public static final Property<Preferences, Config> config = new Property<>();
|
||||
public static final Property<Preferences, LocalBitcoinNode> localBitcoinNode = new Property<>();
|
||||
public static final Property<Preferences, LocalMoneroNode> localMoneroNode = new Property<>();
|
||||
public static final Property<Preferences, String> useTorFlagFromOptions = new Property<>();
|
||||
public static final Property<Preferences, String> referralID = new Property<>();
|
||||
|
||||
public static final Instantiator<Preferences> Preferences = lookup -> new Preferences(
|
||||
lookup.valueOf(storage, new SameValueDonor<PersistenceManager>(null)),
|
||||
lookup.valueOf(config, new SameValueDonor<Config>(null)),
|
||||
lookup.valueOf(localBitcoinNode, new SameValueDonor<LocalBitcoinNode>(null)),
|
||||
lookup.valueOf(useTorFlagFromOptions, new SameValueDonor<String>(null))
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user