check that wallet is synced within tolerance

This commit is contained in:
woodser 2023-11-27 14:30:49 -05:00
parent 5fc7fef223
commit 9957aa6256
29 changed files with 66 additions and 62 deletions

View File

@ -260,17 +260,18 @@ public final class XmrConnectionService {
} }
public boolean isSyncedWithinTolerance() { public boolean isSyncedWithinTolerance() {
if (daemon == null) return false; Long targetHeight = getTargetHeight();
Long targetHeight = lastInfo.getTargetHeight(); // the last time the node thought it was behind the network and was in active sync mode to catch up if (targetHeight == null) return false;
if (targetHeight == 0) return true; // monero-daemon-rpc sync_info's target_height returns 0 when node is fully synced if (targetHeight - chainHeight.get() <= 3) return true; // synced if within 3 blocks of target height
long currentHeight = chainHeight.get();
if (targetHeight - currentHeight <= 3) { // synced if not more than 3 blocks behind target height
return true;
}
log.warn("Our chain height: {} is out of sync with peer nodes chain height: {}", chainHeight.get(), targetHeight); log.warn("Our chain height: {} is out of sync with peer nodes chain height: {}", chainHeight.get(), targetHeight);
return false; return false;
} }
public Long getTargetHeight() {
if (daemon == null || lastInfo == null) return null;
return lastInfo.getTargetHeight() == 0 ? chainHeight.get() : lastInfo.getTargetHeight(); // monerod sync_info's target_height returns 0 when node is fully synced
}
// ----------------------------- APP METHODS ------------------------------ // ----------------------------- APP METHODS ------------------------------
public ReadOnlyIntegerProperty numPeersProperty() { public ReadOnlyIntegerProperty numPeersProperty() {

View File

@ -70,7 +70,7 @@ public class AppStartupState {
}); });
xmrWalletService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> { xmrWalletService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
if (xmrWalletService.isWalletSynced()) if (xmrWalletService.isDownloadComplete())
isWalletSynced.set(true); isWalletSynced.set(true);
}); });

View File

@ -47,7 +47,7 @@ public class MakerReserveOfferFunds extends Task<PlaceOfferModel> {
runInterceptHook(); runInterceptHook();
// verify monero connection // verify monero connection
model.getXmrWalletService().getConnectionsService().verifyConnection(); model.getXmrWalletService().getConnectionService().verifyConnection();
// create reserve tx // create reserve tx
BigInteger makerFee = offer.getMakerFee(); BigInteger makerFee = offer.getMakerFee();

View File

@ -338,7 +338,7 @@ public abstract class SupportManager {
p2PService.isBootstrapped() && p2PService.isBootstrapped() &&
xmrConnectionService.isDownloadComplete() && xmrConnectionService.isDownloadComplete() &&
xmrConnectionService.hasSufficientPeersForBroadcast() && xmrConnectionService.hasSufficientPeersForBroadcast() &&
xmrWalletService.isWalletSynced(); xmrWalletService.isDownloadComplete();
} }

View File

@ -252,18 +252,8 @@ public abstract class DisputeManager<T extends DisputeList<Dispute>> extends Sup
} }
}); });
xmrConnectionService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
if (xmrConnectionService.isDownloadComplete())
tryApplyMessages();
});
xmrWalletService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> { xmrWalletService.downloadPercentageProperty().addListener((observable, oldValue, newValue) -> {
if (xmrWalletService.isWalletSynced()) if (xmrWalletService.isSyncedWithinTolerance())
tryApplyMessages();
});
xmrConnectionService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
if (xmrConnectionService.hasSufficientPeersForBroadcast())
tryApplyMessages(); tryApplyMessages();
}); });

View File

@ -588,7 +588,7 @@ public abstract class Trade implements Tradable, Model {
}); });
// handle daemon changes with max parallelization // handle daemon changes with max parallelization
xmrWalletService.getConnectionsService().addConnectionListener(newConnection -> { xmrWalletService.getConnectionService().addConnectionListener(newConnection -> {
HavenoUtils.submitTask(() -> onConnectionChanged(newConnection)); HavenoUtils.submitTask(() -> onConnectionChanged(newConnection));
}); });
@ -643,7 +643,7 @@ public abstract class Trade implements Tradable, Model {
new Thread(() -> { new Thread(() -> {
GenUtils.waitFor(1000); GenUtils.waitFor(1000);
if (isShutDownStarted) return; if (isShutDownStarted) return;
if (Boolean.TRUE.equals(xmrWalletService.getConnectionsService().isConnected())) xmrWalletService.syncWallet(xmrWalletService.getWallet()); if (Boolean.TRUE.equals(xmrWalletService.getConnectionService().isConnected())) xmrWalletService.syncWallet(xmrWalletService.getWallet());
}).start(); }).start();
// complete disputed trade // complete disputed trade
@ -758,7 +758,7 @@ public abstract class Trade implements Tradable, Model {
} }
public void checkDaemonConnection() { public void checkDaemonConnection() {
XmrConnectionService xmrConnectionService = xmrWalletService.getConnectionsService(); XmrConnectionService xmrConnectionService = xmrWalletService.getConnectionService();
xmrConnectionService.checkConnection(); xmrConnectionService.checkConnection();
xmrConnectionService.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");
@ -783,7 +783,7 @@ public abstract class Trade implements Tradable, Model {
public void syncWalletNormallyForMs(long syncNormalDuration) { public void syncWalletNormallyForMs(long syncNormalDuration) {
syncNormalStartTime = System.currentTimeMillis(); syncNormalStartTime = System.currentTimeMillis();
setWalletRefreshPeriod(xmrWalletService.getConnectionsService().getRefreshPeriodMs()); setWalletRefreshPeriod(xmrWalletService.getConnectionService().getRefreshPeriodMs());
UserThread.runAfter(() -> { UserThread.runAfter(() -> {
if (!isShutDown && System.currentTimeMillis() >= syncNormalStartTime + syncNormalDuration) updateWalletRefreshPeriod(); if (!isShutDown && System.currentTimeMillis() >= syncNormalStartTime + syncNormalDuration) updateWalletRefreshPeriod();
}, syncNormalDuration); }, syncNormalDuration);
@ -1684,7 +1684,7 @@ public abstract class Trade implements Tradable, Model {
*/ */
public long getReprocessDelayInSeconds(int reprocessCount) { public long getReprocessDelayInSeconds(int reprocessCount) {
int retryCycles = 3; // reprocess on next refresh periods for first few attempts (app might auto switch to a good connection) int retryCycles = 3; // reprocess on next refresh periods for first few attempts (app might auto switch to a good connection)
if (reprocessCount < retryCycles) return xmrWalletService.getConnectionsService().getRefreshPeriodMs() / 1000; if (reprocessCount < retryCycles) return xmrWalletService.getConnectionService().getRefreshPeriodMs() / 1000;
long delay = 60; long delay = 60;
for (int i = retryCycles; i < reprocessCount; i++) delay *= 2; for (int i = retryCycles; i < reprocessCount; i++) delay *= 2;
return Math.min(MAX_REPROCESS_DELAY_SECONDS, delay); return Math.min(MAX_REPROCESS_DELAY_SECONDS, delay);
@ -1785,7 +1785,7 @@ public abstract class Trade implements Tradable, Model {
if (!wasWalletSynced) { if (!wasWalletSynced) {
wasWalletSynced = true; wasWalletSynced = true;
if (xmrWalletService.isProxyApplied(wasWalletSynced)) { if (xmrWalletService.isProxyApplied(wasWalletSynced)) {
onConnectionChanged(xmrWalletService.getConnectionsService().getConnection()); onConnectionChanged(xmrWalletService.getConnectionService().getConnection());
} }
} }
@ -1843,7 +1843,7 @@ public abstract class Trade implements Tradable, Model {
try { try {
// log warning if wallet is too far behind daemon // log warning if wallet is too far behind daemon
MoneroDaemonInfo lastInfo = xmrWalletService.getConnectionsService().getLastInfo(); MoneroDaemonInfo lastInfo = xmrWalletService.getConnectionService().getLastInfo();
long walletHeight = wallet.getHeight(); long walletHeight = wallet.getHeight();
if (wasWalletSynced && isDepositsPublished() && lastInfo != null && walletHeight < lastInfo.getHeight() - 3 && !Config.baseCurrencyNetwork().isTestnet()) { if (wasWalletSynced && isDepositsPublished() && lastInfo != null && walletHeight < lastInfo.getHeight() - 3 && !Config.baseCurrencyNetwork().isTestnet()) {
log.warn("Wallet is more than 3 blocks behind monerod for {} {}, wallet height={}, monerod height={},", getClass().getSimpleName(), getShortId(), walletHeight, lastInfo.getHeight()); log.warn("Wallet is more than 3 blocks behind monerod for {} {}, wallet height={}, monerod height={},", getClass().getSimpleName(), getShortId(), walletHeight, lastInfo.getHeight());
@ -1924,7 +1924,7 @@ public abstract class Trade implements Tradable, Model {
} }
} catch (Exception e) { } catch (Exception e) {
if (!isShutDownStarted && wallet != null && isWalletConnected()) { if (!isShutDownStarted && wallet != null && isWalletConnected()) {
log.warn("Error polling trade wallet for {} {}: {}. Monerod={}", getClass().getSimpleName(), getId(), e.getMessage(), getXmrWalletService().getConnectionsService().getConnection()); log.warn("Error polling trade wallet for {} {}: {}. Monerod={}", getClass().getSimpleName(), getId(), e.getMessage(), getXmrWalletService().getConnectionService().getConnection());
} }
} }
} }
@ -1932,7 +1932,7 @@ public abstract class Trade implements Tradable, Model {
private long getWalletRefreshPeriod() { private long getWalletRefreshPeriod() {
if (isIdling()) return IDLE_SYNC_PERIOD_MS; if (isIdling()) return IDLE_SYNC_PERIOD_MS;
return xmrWalletService.getConnectionsService().getRefreshPeriodMs(); return xmrWalletService.getConnectionService().getRefreshPeriodMs();
} }
private void setStateDepositsPublished() { private void setStateDepositsPublished() {

View File

@ -1285,7 +1285,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
// listen for block confirmation to remove trade // listen for block confirmation to remove trade
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
heightSubscription = EasyBind.subscribe(xmrWalletService.getConnectionsService().chainHeightProperty(), lastBlockHeight -> { heightSubscription = EasyBind.subscribe(xmrWalletService.getConnectionService().chainHeightProperty(), lastBlockHeight -> {
if (isShutDown) return; if (isShutDown) return;
if (startHeight == null) startHeight = lastBlockHeight.longValue(); if (startHeight == null) startHeight = lastBlockHeight.longValue();
if (lastBlockHeight.longValue() >= startHeight + REMOVE_AFTER_NUM_CONFIRMATIONS) { if (lastBlockHeight.longValue() >= startHeight + REMOVE_AFTER_NUM_CONFIRMATIONS) {

View File

@ -823,7 +823,7 @@ public abstract class TradeProtocol implements DecryptedDirectMessageListener, D
} }
void handleTaskRunnerFault(NodeAddress ackReceiver, @Nullable TradeMessage message, String source, String errorMessage) { void handleTaskRunnerFault(NodeAddress ackReceiver, @Nullable TradeMessage message, String source, String errorMessage) {
log.error("Task runner failed with error {}. Triggered from {}. Monerod={}" , errorMessage, source, trade.getXmrWalletService().getConnectionsService().getConnection()); log.error("Task runner failed with error {}. Triggered from {}. Monerod={}" , errorMessage, source, trade.getXmrWalletService().getConnectionService().getConnection());
if (message != null) { if (message != null) {
sendAckMessage(ackReceiver, message, false, errorMessage); sendAckMessage(ackReceiver, message, false, errorMessage);

View File

@ -215,10 +215,6 @@ public class XmrWalletService {
return accountService.getPassword() != null; return accountService.getPassword() != null;
} }
public boolean isWalletSynced() {
return downloadPercentageProperty().get() == 1d;
}
public ReadOnlyDoubleProperty downloadPercentageProperty() { public ReadOnlyDoubleProperty downloadPercentageProperty() {
return downloadListener.percentageProperty(); return downloadListener.percentageProperty();
} }
@ -227,15 +223,27 @@ public class XmrWalletService {
downloadListener.doneDownload(); downloadListener.doneDownload();
} }
public boolean isDownloadComplete() {
return downloadPercentageProperty().get() == 1d;
}
public LongProperty walletHeightProperty() { public LongProperty walletHeightProperty() {
return walletHeight; return walletHeight;
} }
public boolean isSyncedWithinTolerance() {
if (!xmrConnectionService.isSyncedWithinTolerance()) return false;
Long targetHeight = xmrConnectionService.getTargetHeight();
if (targetHeight == null) return false;
if (targetHeight - walletHeight.get() <= 3) return true; // synced if within 3 blocks of target height
return false;
}
public MoneroDaemonRpc getDaemon() { public MoneroDaemonRpc getDaemon() {
return xmrConnectionService.getDaemon(); return xmrConnectionService.getDaemon();
} }
public XmrConnectionService getConnectionsService() { public XmrConnectionService getConnectionService() {
return xmrConnectionService; return xmrConnectionService;
} }
@ -721,6 +729,7 @@ public class XmrWalletService {
log.info("Syncing main wallet"); log.info("Syncing main wallet");
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
wallet.sync(); // blocking wallet.sync(); // blocking
walletHeight.set(wallet.getHeight());
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(xmrConnectionService.getRefreshPeriodMs()); wallet.startSyncing(xmrConnectionService.getRefreshPeriodMs());

View File

@ -2100,7 +2100,7 @@ popup.warning.noMediatorsAvailable=There are no mediators available.
popup.warning.notFullyConnected=You need to wait until you are fully connected to the network.\nThat might take up to about 2 minutes at startup. popup.warning.notFullyConnected=You need to wait until you are fully connected to the network.\nThat might take up to about 2 minutes at startup.
popup.warning.notSufficientConnectionsToXmrNetwork=You need to wait until you have at least {0} connections to the Monero network. popup.warning.notSufficientConnectionsToXmrNetwork=You need to wait until you have at least {0} connections to the Monero network.
popup.warning.downloadNotComplete=You need to wait until the download of missing Monero blocks is complete. popup.warning.downloadNotComplete=You need to wait until the download of missing Monero blocks is complete.
popup.warning.chainNotSynced=The Haveno wallet is not synced with the latest blockchain height. Please wait until the wallet syncs or check your connection. popup.warning.walletNotSynced=The Haveno wallet is not synced with the latest blockchain height. Please wait until the wallet syncs or check your connection.
popup.warning.removeOffer=Are you sure you want to remove that offer? popup.warning.removeOffer=Are you sure you want to remove that offer?
popup.warning.tooLargePercentageValue=You cannot set a percentage of 100% or larger. popup.warning.tooLargePercentageValue=You cannot set a percentage of 100% or larger.
popup.warning.examplePercentageValue=Please enter a percentage number like \"5.4\" for 5.4% popup.warning.examplePercentageValue=Please enter a percentage number like \"5.4\" for 5.4%

View File

@ -1581,7 +1581,7 @@ popup.warning.noMediatorsAvailable=Nejsou k dispozici žádní mediátoři.
popup.warning.notFullyConnected=Musíte počkat, až budete plně připojeni k síti.\nTo může při spuštění trvat až 2 minuty. popup.warning.notFullyConnected=Musíte počkat, až budete plně připojeni k síti.\nTo může při spuštění trvat až 2 minuty.
popup.warning.notSufficientConnectionsToXmrNetwork=Musíte počkat, až budete mít alespoň {0} připojení k moneroové síti. popup.warning.notSufficientConnectionsToXmrNetwork=Musíte počkat, až budete mít alespoň {0} připojení k moneroové síti.
popup.warning.downloadNotComplete=Musíte počkat, až bude stahování chybějících moneroových bloků kompletní. popup.warning.downloadNotComplete=Musíte počkat, až bude stahování chybějících moneroových bloků kompletní.
popup.warning.chainNotSynced=Haveno peněženka není synchronizována s nejnovější výškou blockchainu. Počkejte, dokud se peněženka nesynchronizuje, nebo zkontrolujte své připojení. popup.warning.walletNotSynced=Haveno peněženka není synchronizována s nejnovější výškou blockchainu. Počkejte, dokud se peněženka nesynchronizuje, nebo zkontrolujte své připojení.
popup.warning.removeOffer=Opravdu chcete tuto nabídku odebrat? popup.warning.removeOffer=Opravdu chcete tuto nabídku odebrat?
popup.warning.tooLargePercentageValue=Nelze nastavit procento 100% nebo větší. popup.warning.tooLargePercentageValue=Nelze nastavit procento 100% nebo větší.
popup.warning.examplePercentageValue=Zadejte procento jako číslo \"5.4\" pro 5.4% popup.warning.examplePercentageValue=Zadejte procento jako číslo \"5.4\" pro 5.4%

View File

@ -1581,7 +1581,7 @@ popup.warning.noMediatorsAvailable=Es sind keine Mediatoren verfügbar.
popup.warning.notFullyConnected=Sie müssen warten, bis Sie vollständig mit dem Netzwerk verbunden sind.\nDas kann bis ungefähr 2 Minuten nach dem Start dauern. popup.warning.notFullyConnected=Sie müssen warten, bis Sie vollständig mit dem Netzwerk verbunden sind.\nDas kann bis ungefähr 2 Minuten nach dem Start dauern.
popup.warning.notSufficientConnectionsToXmrNetwork=Sie müssen warten, bis Sie wenigstens {0} Verbindungen zum Moneronetzwerk haben. popup.warning.notSufficientConnectionsToXmrNetwork=Sie müssen warten, bis Sie wenigstens {0} Verbindungen zum Moneronetzwerk haben.
popup.warning.downloadNotComplete=Sie müssen warten bis der Download der fehlenden Moneroblöcke abgeschlossen ist. popup.warning.downloadNotComplete=Sie müssen warten bis der Download der fehlenden Moneroblöcke abgeschlossen ist.
popup.warning.chainNotSynced=Die Haveno-Brieftasche ist nicht mit der neuesten Höhe der Blockchain synchronisiert. Bitte warten Sie, bis die Brieftasche synchronisiert ist, oder überprüfen Sie Ihre Verbindung. popup.warning.walletNotSynced=Die Haveno-Brieftasche ist nicht mit der neuesten Höhe der Blockchain synchronisiert. Bitte warten Sie, bis die Brieftasche synchronisiert ist, oder überprüfen Sie Ihre Verbindung.
popup.warning.removeOffer=Sind Sie sicher, dass Sie das Angebot entfernen wollen? popup.warning.removeOffer=Sind Sie sicher, dass Sie das Angebot entfernen wollen?
popup.warning.tooLargePercentageValue=Es kann kein Prozentsatz von 100% oder mehr verwendet werden. popup.warning.tooLargePercentageValue=Es kann kein Prozentsatz von 100% oder mehr verwendet werden.
popup.warning.examplePercentageValue=Bitte geben sei einen Prozentsatz wie folgt ein \"5.4\" für 5.4% popup.warning.examplePercentageValue=Bitte geben sei einen Prozentsatz wie folgt ein \"5.4\" für 5.4%

View File

@ -1581,7 +1581,7 @@ popup.warning.noMediatorsAvailable=No hay mediadores disponibles.
popup.warning.notFullyConnected=Necesita esperar hasta que esté completamente conectado a la red.\nPuede llevar hasta 2 minutos al inicio. popup.warning.notFullyConnected=Necesita esperar hasta que esté completamente conectado a la red.\nPuede llevar hasta 2 minutos al inicio.
popup.warning.notSufficientConnectionsToXmrNetwork=Necesita esperar hasta que tenga al menos {0} conexiones a la red Monero. popup.warning.notSufficientConnectionsToXmrNetwork=Necesita esperar hasta que tenga al menos {0} conexiones a la red Monero.
popup.warning.downloadNotComplete=Tiene que esperar hasta que finalice la descarga de los bloques Monero que faltan. popup.warning.downloadNotComplete=Tiene que esperar hasta que finalice la descarga de los bloques Monero que faltan.
popup.warning.chainNotSynced=La billetera Haveno no está sincronizada con la última altura de la cadena de bloques. Por favor, espere hasta que la billetera se sincronice o verifique su conexión. popup.warning.walletNotSynced=La billetera Haveno no está sincronizada con la última altura de la cadena de bloques. Por favor, espere hasta que la billetera se sincronice o verifique su conexión.
popup.warning.removeOffer=¿Está seguro que quiere eliminar la oferta? popup.warning.removeOffer=¿Está seguro que quiere eliminar la oferta?
popup.warning.tooLargePercentageValue=No puede establecer un porcentaje del 100% o superior. popup.warning.tooLargePercentageValue=No puede establecer un porcentaje del 100% o superior.
popup.warning.examplePercentageValue=Por favor, introduzca un número de porcentaje como \"5.4\" para 5.4% popup.warning.examplePercentageValue=Por favor, introduzca un número de porcentaje como \"5.4\" para 5.4%

View File

@ -1578,7 +1578,7 @@ popup.warning.noMediatorsAvailable=There are no mediators available.
popup.warning.notFullyConnected=شما باید منتظر بمانید تا به طور کامل به شبکه متصل شوید. \nاین ممکن است در هنگام راه اندازی حدود 2 دقیقه طول بکشد. popup.warning.notFullyConnected=شما باید منتظر بمانید تا به طور کامل به شبکه متصل شوید. \nاین ممکن است در هنگام راه اندازی حدود 2 دقیقه طول بکشد.
popup.warning.notSufficientConnectionsToXmrNetwork=شما باید منتظر بمانید تا حداقل {0} اتصال به شبکه بیتکوین داشته باشید. popup.warning.notSufficientConnectionsToXmrNetwork=شما باید منتظر بمانید تا حداقل {0} اتصال به شبکه بیتکوین داشته باشید.
popup.warning.downloadNotComplete=شما باید منتظر بمانید تا بارگیری بلاک های بیتکوین باقیمانده کامل شود. popup.warning.downloadNotComplete=شما باید منتظر بمانید تا بارگیری بلاک های بیتکوین باقیمانده کامل شود.
popup.warning.chainNotSynced=کیف پول Haveno با ارتفاع آخرین بلوکچین هماهنگ نشده است. لطفاً منتظر بمانید تا کیف پول هماهنگ شود یا اتصال خود را بررسی کنید. popup.warning.walletNotSynced=کیف پول Haveno با ارتفاع آخرین بلوکچین هماهنگ نشده است. لطفاً منتظر بمانید تا کیف پول هماهنگ شود یا اتصال خود را بررسی کنید.
popup.warning.removeOffer=آیا شما مطمئن هستید که می خواهید این پیشنهاد را حذف کنید؟ popup.warning.removeOffer=آیا شما مطمئن هستید که می خواهید این پیشنهاد را حذف کنید؟
popup.warning.tooLargePercentageValue=شما نمیتوانید درصد 100٪ یا بیشتر را تنظیم کنید. popup.warning.tooLargePercentageValue=شما نمیتوانید درصد 100٪ یا بیشتر را تنظیم کنید.
popup.warning.examplePercentageValue=لطفا یک عدد درصد مانند \"5.4\" برای 5.4% وارد کنید popup.warning.examplePercentageValue=لطفا یک عدد درصد مانند \"5.4\" برای 5.4% وارد کنید

View File

@ -1582,7 +1582,7 @@ popup.warning.noMediatorsAvailable=Il n'y a pas de médiateurs disponibles.
popup.warning.notFullyConnected=Vous devez attendre d'être complètement connecté au réseau.\nCela peut prendre jusqu'à 2 minutes au démarrage. popup.warning.notFullyConnected=Vous devez attendre d'être complètement connecté au réseau.\nCela peut prendre jusqu'à 2 minutes au démarrage.
popup.warning.notSufficientConnectionsToXmrNetwork=Vous devez attendre d''avoir au minimum {0} connexions au réseau Monero. popup.warning.notSufficientConnectionsToXmrNetwork=Vous devez attendre d''avoir au minimum {0} connexions au réseau Monero.
popup.warning.downloadNotComplete=Vous devez attendre que le téléchargement des blocs Monero manquants soit terminé. popup.warning.downloadNotComplete=Vous devez attendre que le téléchargement des blocs Monero manquants soit terminé.
popup.warning.chainNotSynced=Le portefeuille Haveno n'est pas synchronisé avec la hauteur la plus récente de la blockchain. Veuillez patienter jusqu'à ce que le portefeuille soit synchronisé ou vérifiez votre connexion. popup.warning.walletNotSynced=Le portefeuille Haveno n'est pas synchronisé avec la hauteur la plus récente de la blockchain. Veuillez patienter jusqu'à ce que le portefeuille soit synchronisé ou vérifiez votre connexion.
popup.warning.removeOffer=Vous êtes certain de vouloir retirer cet ordre? popup.warning.removeOffer=Vous êtes certain de vouloir retirer cet ordre?
popup.warning.tooLargePercentageValue=Vous ne pouvez pas définir un pourcentage de 100% ou plus grand. popup.warning.tooLargePercentageValue=Vous ne pouvez pas définir un pourcentage de 100% ou plus grand.
popup.warning.examplePercentageValue=Merci de saisir un nombre sous la forme d'un pourcentage tel que \"5.4\" pour 5.4% popup.warning.examplePercentageValue=Merci de saisir un nombre sous la forme d'un pourcentage tel que \"5.4\" pour 5.4%

View File

@ -1580,7 +1580,7 @@ popup.warning.noMediatorsAvailable=Non ci sono mediatori disponibili.
popup.warning.notFullyConnected=È necessario attendere fino a quando non si è completamente connessi alla rete.\nQuesto potrebbe richiedere fino a circa 2 minuti all'avvio. popup.warning.notFullyConnected=È necessario attendere fino a quando non si è completamente connessi alla rete.\nQuesto potrebbe richiedere fino a circa 2 minuti all'avvio.
popup.warning.notSufficientConnectionsToXmrNetwork=Devi aspettare fino a quando non hai almeno {0} connessioni alla rete Monero. popup.warning.notSufficientConnectionsToXmrNetwork=Devi aspettare fino a quando non hai almeno {0} connessioni alla rete Monero.
popup.warning.downloadNotComplete=Devi aspettare fino al completamento del download dei blocchi Monero mancanti. popup.warning.downloadNotComplete=Devi aspettare fino al completamento del download dei blocchi Monero mancanti.
popup.warning.chainNotSynced=Il portafoglio Haveno non è sincronizzato con l'altezza più recente della blockchain. Si prega di attendere finché il portafoglio si sincronizza o controllare la connessione. popup.warning.walletNotSynced=Il portafoglio Haveno non è sincronizzato con l'altezza più recente della blockchain. Si prega di attendere finché il portafoglio si sincronizza o controllare la connessione.
popup.warning.removeOffer=Sei sicuro di voler rimuovere quell'offerta? popup.warning.removeOffer=Sei sicuro di voler rimuovere quell'offerta?
popup.warning.tooLargePercentageValue=Non è possibile impostare una percentuale del 100% o superiore. popup.warning.tooLargePercentageValue=Non è possibile impostare una percentuale del 100% o superiore.
popup.warning.examplePercentageValue=Inserisci un numero percentuale come \"5.4\" per il 5,4% popup.warning.examplePercentageValue=Inserisci un numero percentuale come \"5.4\" per il 5,4%

View File

@ -1581,7 +1581,7 @@ popup.warning.noMediatorsAvailable=利用可能な調停人がいません。
popup.warning.notFullyConnected=ネットワークへ完全に接続するまで待つ必要があります。\n起動までに約2分かかります。 popup.warning.notFullyConnected=ネットワークへ完全に接続するまで待つ必要があります。\n起動までに約2分かかります。
popup.warning.notSufficientConnectionsToXmrNetwork=少なくとも{0}のビットコインネットワークへの接続が確立されるまでお待ちください。 popup.warning.notSufficientConnectionsToXmrNetwork=少なくとも{0}のビットコインネットワークへの接続が確立されるまでお待ちください。
popup.warning.downloadNotComplete=欠落しているビットコインブロックのダウンロードが完了するまで待つ必要があります。 popup.warning.downloadNotComplete=欠落しているビットコインブロックのダウンロードが完了するまで待つ必要があります。
popup.warning.chainNotSynced=Havenoウォレットのブロックチェーン高さは正しく同期されていません。アプリを最近起動した場合、1つのビットコインブロックが発行されるまで待って下さい。\n\nブロックチェーン高さは\"設定/ネットワーク情報\"に表示されます。 2つ以上のブロックが発行されても問題が解決されない場合、フリーズしている可能性があります。その場合には、SPV再同期を行って下さい [HYPERLINK: https://haveno.exchange/wiki/Resyncing_SPV_file ]。 popup.warning.walletNotSynced=Havenoウォレットのブロックチェーン高さは正しく同期されていません。アプリを最近起動した場合、1つのビットコインブロックが発行されるまで待って下さい。\n\nブロックチェーン高さは\"設定/ネットワーク情報\"に表示されます。 2つ以上のブロックが発行されても問題が解決されない場合、フリーズしている可能性があります。その場合には、SPV再同期を行って下さい [HYPERLINK: https://haveno.exchange/wiki/Resyncing_SPV_file ]。
popup.warning.removeOffer=本当にオファーを削除しますか? popup.warning.removeOffer=本当にオファーを削除しますか?
popup.warning.tooLargePercentageValue=100%以上のパーセントを設定できません popup.warning.tooLargePercentageValue=100%以上のパーセントを設定できません
popup.warning.examplePercentageValue=パーセントの数字を入力してください。5.4%は「5.4」のように入力します。 popup.warning.examplePercentageValue=パーセントの数字を入力してください。5.4%は「5.4」のように入力します。

View File

@ -1586,7 +1586,7 @@ popup.warning.noMediatorsAvailable=Não há mediadores disponíveis.
popup.warning.notFullyConnected=Você precisa aguardar até estar totalmente conectado à rede.\nIsto pode levar até 2 minutos na inicialização do programa. popup.warning.notFullyConnected=Você precisa aguardar até estar totalmente conectado à rede.\nIsto pode levar até 2 minutos na inicialização do programa.
popup.warning.notSufficientConnectionsToXmrNetwork=Você precisa esperar até ter pelo menos {0} conexões à rede Monero. popup.warning.notSufficientConnectionsToXmrNetwork=Você precisa esperar até ter pelo menos {0} conexões à rede Monero.
popup.warning.downloadNotComplete=Você precisa aguardar até que termine o download dos blocos de Monero restantes popup.warning.downloadNotComplete=Você precisa aguardar até que termine o download dos blocos de Monero restantes
popup.warning.chainNotSynced=A carteira Haveno não está sincronizada com a altura mais recente da blockchain. Por favor, aguarde até que a carteira seja sincronizada ou verifique sua conexão. popup.warning.walletNotSynced=A carteira Haveno não está sincronizada com a altura mais recente da blockchain. Por favor, aguarde até que a carteira seja sincronizada ou verifique sua conexão.
popup.warning.removeOffer=Tem certeza que deseja remover essa oferta? popup.warning.removeOffer=Tem certeza que deseja remover essa oferta?
popup.warning.tooLargePercentageValue=Você não pode definir uma porcentagem superior a 100%. popup.warning.tooLargePercentageValue=Você não pode definir uma porcentagem superior a 100%.
popup.warning.examplePercentageValue=Digite um número percentual, como \"5.4\" para 5.4% popup.warning.examplePercentageValue=Digite um número percentual, como \"5.4\" para 5.4%

View File

@ -1578,7 +1578,7 @@ popup.warning.noMediatorsAvailable=Não há mediadores disponíveis.
popup.warning.notFullyConnected=Você precisa esperar até estar totalmente conectado à rede.\nIsso pode levar cerca de 2 minutos na inicialização. popup.warning.notFullyConnected=Você precisa esperar até estar totalmente conectado à rede.\nIsso pode levar cerca de 2 minutos na inicialização.
popup.warning.notSufficientConnectionsToXmrNetwork=Você precisa esperar até que você tenha pelo menos {0} conexões com a rede Monero. popup.warning.notSufficientConnectionsToXmrNetwork=Você precisa esperar até que você tenha pelo menos {0} conexões com a rede Monero.
popup.warning.downloadNotComplete=Você precisa esperar até que o download dos blocos de Monero ausentes esteja completo. popup.warning.downloadNotComplete=Você precisa esperar até que o download dos blocos de Monero ausentes esteja completo.
popup.warning.chainNotSynced=A carteira Haveno não está sincronizada com a altura mais recente da blockchain. Por favor, aguarde até que a carteira seja sincronizada ou verifique a sua conexão. popup.warning.walletNotSynced=A carteira Haveno não está sincronizada com a altura mais recente da blockchain. Por favor, aguarde até que a carteira seja sincronizada ou verifique a sua conexão.
popup.warning.removeOffer=Tem certeza de que deseja remover essa oferta? popup.warning.removeOffer=Tem certeza de que deseja remover essa oferta?
popup.warning.tooLargePercentageValue=Você não pode definir uma percentagem superior à 100%. popup.warning.tooLargePercentageValue=Você não pode definir uma percentagem superior à 100%.
popup.warning.examplePercentageValue=Por favor digitar um número percentual como \"5.4\" para 5.4% popup.warning.examplePercentageValue=Por favor digitar um número percentual como \"5.4\" para 5.4%

View File

@ -1579,7 +1579,7 @@ popup.warning.noMediatorsAvailable=There are no mediators available.
popup.warning.notFullyConnected=Необходимо дождаться полного подключения к сети.\nОно может занять до 2 минут. popup.warning.notFullyConnected=Необходимо дождаться полного подключения к сети.\nОно может занять до 2 минут.
popup.warning.notSufficientConnectionsToXmrNetwork=Необходимо дождаться не менее {0} соединений с сетью Биткойн. popup.warning.notSufficientConnectionsToXmrNetwork=Необходимо дождаться не менее {0} соединений с сетью Биткойн.
popup.warning.downloadNotComplete=Необходимо дождаться завершения загрузки недостающих блоков сети Биткойн. popup.warning.downloadNotComplete=Необходимо дождаться завершения загрузки недостающих блоков сети Биткойн.
popup.warning.chainNotSynced=Кошелек Haveno не синхронизирован с последней высотой блокчейна. Пожалуйста, подождите, пока кошелек синхронизируется, или проверьте ваше соединение. popup.warning.walletNotSynced=Кошелек Haveno не синхронизирован с последней высотой блокчейна. Пожалуйста, подождите, пока кошелек синхронизируется, или проверьте ваше соединение.
popup.warning.removeOffer=Действительно хотите удалить это предложение? popup.warning.removeOffer=Действительно хотите удалить это предложение?
popup.warning.tooLargePercentageValue=Нельзя установить процент в размере 100% или выше. popup.warning.tooLargePercentageValue=Нельзя установить процент в размере 100% или выше.
popup.warning.examplePercentageValue=Введите процент, например \«5,4\» для 5,4% popup.warning.examplePercentageValue=Введите процент, например \«5,4\» для 5,4%

View File

@ -1579,7 +1579,7 @@ popup.warning.noMediatorsAvailable=There are no mediators available.
popup.warning.notFullyConnected=คุณต้องรอจนกว่าคุณจะเชื่อมต่อกับเครือข่ายอย่างสมบูรณ์\nอาจใช้เวลาประมาณ 2 นาทีเมื่อเริ่มต้น popup.warning.notFullyConnected=คุณต้องรอจนกว่าคุณจะเชื่อมต่อกับเครือข่ายอย่างสมบูรณ์\nอาจใช้เวลาประมาณ 2 นาทีเมื่อเริ่มต้น
popup.warning.notSufficientConnectionsToXmrNetwork=คุณต้องรอจนกว่าจะมีการเชื่อมต่อกับเครือข่าย Monero อย่างน้อย {0} รายการ popup.warning.notSufficientConnectionsToXmrNetwork=คุณต้องรอจนกว่าจะมีการเชื่อมต่อกับเครือข่าย Monero อย่างน้อย {0} รายการ
popup.warning.downloadNotComplete=คุณต้องรอจนกว่าการดาวน์โหลดบล็อค Monero ที่ขาดหายไปจะเสร็จสมบูรณ์ popup.warning.downloadNotComplete=คุณต้องรอจนกว่าการดาวน์โหลดบล็อค Monero ที่ขาดหายไปจะเสร็จสมบูรณ์
popup.warning.chainNotSynced=กระเป๋า Haveno ไม่ได้ปรับข้อมูลกับความสูงของบล็อกเชนล่าสุด โปรดรอให้กระเป๋าปรับข้อมูลหรือตรวจสอบการเชื่อมต่อของคุณ popup.warning.walletNotSynced=กระเป๋า Haveno ไม่ได้ปรับข้อมูลกับความสูงของบล็อกเชนล่าสุด โปรดรอให้กระเป๋าปรับข้อมูลหรือตรวจสอบการเชื่อมต่อของคุณ
popup.warning.removeOffer=คุณแน่ใจหรือไม่ว่าต้องการนำข้อเสนอนั้นออก popup.warning.removeOffer=คุณแน่ใจหรือไม่ว่าต้องการนำข้อเสนอนั้นออก
popup.warning.tooLargePercentageValue=คุณไม่สามารถกำหนดเปอร์เซ็นต์เป็น 100% หรือมากกว่าได้ popup.warning.tooLargePercentageValue=คุณไม่สามารถกำหนดเปอร์เซ็นต์เป็น 100% หรือมากกว่าได้
popup.warning.examplePercentageValue=โปรดป้อนตัวเลขเปอร์เซ็นต์เช่น \"5.4 \" เป็น 5.4% popup.warning.examplePercentageValue=โปรดป้อนตัวเลขเปอร์เซ็นต์เช่น \"5.4 \" เป็น 5.4%

View File

@ -1581,7 +1581,7 @@ popup.warning.noMediatorsAvailable=There are no mediators available.
popup.warning.notFullyConnected=Bạn cần phải đợi cho đến khi kết nối hoàn toàn với mạng.\nĐiều này mất khoảng 2 phút khi khởi động. popup.warning.notFullyConnected=Bạn cần phải đợi cho đến khi kết nối hoàn toàn với mạng.\nĐiều này mất khoảng 2 phút khi khởi động.
popup.warning.notSufficientConnectionsToXmrNetwork=Bạn cần phải đợi cho đến khi bạn có ít nhất {0} kết nối với mạng Monero. popup.warning.notSufficientConnectionsToXmrNetwork=Bạn cần phải đợi cho đến khi bạn có ít nhất {0} kết nối với mạng Monero.
popup.warning.downloadNotComplete=Bạn cần phải đợi cho đến khi download xong các block Monero còn thiếu. popup.warning.downloadNotComplete=Bạn cần phải đợi cho đến khi download xong các block Monero còn thiếu.
popup.warning.chainNotSynced=Ví Haveno chưa được đồng bộ với chiều cao khối chuỗi khối mới nhất. Vui lòng đợi cho đến khi ví được đồng bộ hoặc kiểm tra kết nối của bạn. popup.warning.walletNotSynced=Ví Haveno chưa được đồng bộ với chiều cao khối chuỗi khối mới nhất. Vui lòng đợi cho đến khi ví được đồng bộ hoặc kiểm tra kết nối của bạn.
popup.warning.removeOffer=Bạn có chắc bạn muốn gỡ bỏ Báo giá này? popup.warning.removeOffer=Bạn có chắc bạn muốn gỡ bỏ Báo giá này?
popup.warning.tooLargePercentageValue=Bạn không thể cài đặt phần trăm là 100% hoặc cao hơn. popup.warning.tooLargePercentageValue=Bạn không thể cài đặt phần trăm là 100% hoặc cao hơn.
popup.warning.examplePercentageValue=Vui lòng nhập số phần trăm như \"5.4\" cho 5,4% popup.warning.examplePercentageValue=Vui lòng nhập số phần trăm như \"5.4\" cho 5,4%

View File

@ -1583,7 +1583,7 @@ popup.warning.noMediatorsAvailable=没有调解员可用。
popup.warning.notFullyConnected=您需要等到您完全连接到网络\n在启动时可能需要2分钟。 popup.warning.notFullyConnected=您需要等到您完全连接到网络\n在启动时可能需要2分钟。
popup.warning.notSufficientConnectionsToXmrNetwork=你需要等待至少有{0}个与比特币网络的连接点。 popup.warning.notSufficientConnectionsToXmrNetwork=你需要等待至少有{0}个与比特币网络的连接点。
popup.warning.downloadNotComplete=您需要等待,直到丢失的比特币区块被下载完毕。 popup.warning.downloadNotComplete=您需要等待,直到丢失的比特币区块被下载完毕。
popup.warning.chainNotSynced=Haveno 钱包尚未与最新的区块链高度同步。请等待钱包同步完成或检查您的连接。 popup.warning.walletNotSynced=Haveno 钱包尚未与最新的区块链高度同步。请等待钱包同步完成或检查您的连接。
popup.warning.removeOffer=您确定要移除该报价吗? popup.warning.removeOffer=您确定要移除该报价吗?
popup.warning.tooLargePercentageValue=您不能设置100或更大的百分比。 popup.warning.tooLargePercentageValue=您不能设置100或更大的百分比。
popup.warning.examplePercentageValue=请输入百分比数字,如 5.4 是“5.4” popup.warning.examplePercentageValue=请输入百分比数字,如 5.4 是“5.4”

View File

@ -1581,7 +1581,7 @@ popup.warning.noMediatorsAvailable=沒有調解員可用。
popup.warning.notFullyConnected=您需要等到您完全連接到網絡\n在啟動時可能需要2分鐘。 popup.warning.notFullyConnected=您需要等到您完全連接到網絡\n在啟動時可能需要2分鐘。
popup.warning.notSufficientConnectionsToXmrNetwork=你需要等待至少有{0}個與比特幣網絡的連接點。 popup.warning.notSufficientConnectionsToXmrNetwork=你需要等待至少有{0}個與比特幣網絡的連接點。
popup.warning.downloadNotComplete=您需要等待,直到丟失的比特幣區塊被下載完畢。 popup.warning.downloadNotComplete=您需要等待,直到丟失的比特幣區塊被下載完畢。
popup.warning.chainNotSynced=Haveno 錢包尚未與最新的區塊鏈高度同步。請等待錢包同步完成或檢查您的連接。 popup.warning.walletNotSynced=Haveno 錢包尚未與最新的區塊鏈高度同步。請等待錢包同步完成或檢查您的連接。
popup.warning.removeOffer=您確定要移除該報價嗎? popup.warning.removeOffer=您確定要移除該報價嗎?
popup.warning.tooLargePercentageValue=您不能設置100或更大的百分比。 popup.warning.tooLargePercentageValue=您不能設置100或更大的百分比。
popup.warning.examplePercentageValue=請輸入百分比數字,如 5.4 是“5.4” popup.warning.examplePercentageValue=請輸入百分比數字,如 5.4 是“5.4”

View File

@ -172,7 +172,7 @@ public class TxIdTextField extends AnchorPane {
MoneroTx tx = null; MoneroTx tx = null;
try { try {
tx = useCache ? xmrWalletService.getTxWithCache(txId) : xmrWalletService.getTx(txId); tx = useCache ? xmrWalletService.getTxWithCache(txId) : xmrWalletService.getTx(txId);
tx.setNumConfirmations(tx.isConfirmed() ? (height == null ? xmrWalletService.getConnectionsService().getLastInfo().getHeight() : height) - tx.getHeight(): 0l); // TODO: don't set if tx.getNumConfirmations() works reliably on non-local testnet tx.setNumConfirmations(tx.isConfirmed() ? (height == null ? xmrWalletService.getConnectionService().getLastInfo().getHeight() : height) - tx.getHeight(): 0l); // TODO: don't set if tx.getNumConfirmations() works reliably on non-local testnet
} catch (Exception e) { } catch (Exception e) {
// do nothing // do nothing
} }

View File

@ -193,7 +193,7 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
private void onWithdraw() { private void onWithdraw() {
if (GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrWalletService.getConnectionsService())) { if (GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrWalletService)) {
try { try {
// get withdraw address // get withdraw address

View File

@ -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.getXmrConnectionService()) && GUIUtil.isWalletSyncedWithinToleranceOrShowPopup(openOfferManager.getXmrWalletService()) &&
GUIUtil.isBootstrappedOrShowPopup(p2PService); GUIUtil.isBootstrappedOrShowPopup(p2PService);
} }

View File

@ -544,7 +544,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
} }
public boolean isReadyForTxBroadcast() { public boolean isReadyForTxBroadcast() {
return GUIUtil.isBootstrappedOrShowPopup(p2PService) && GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrConnectionService); return GUIUtil.isBootstrappedOrShowPopup(p2PService) && GUIUtil.isReadyForTxBroadcastOrShowPopup(xmrWalletService);
} }
public boolean isBootstrappedOrShowPopup() { public boolean isBootstrappedOrShowPopup() {

View File

@ -689,7 +689,8 @@ public class GUIUtil {
return false; return false;
} }
public static boolean isReadyForTxBroadcastOrShowPopup(XmrConnectionService xmrConnectionService) { public static boolean isReadyForTxBroadcastOrShowPopup(XmrWalletService xmrWalletService) {
XmrConnectionService xmrConnectionService = xmrWalletService.getConnectionService();
if (!xmrConnectionService.hasSufficientPeersForBroadcast()) { if (!xmrConnectionService.hasSufficientPeersForBroadcast()) {
new Popup().information(Res.get("popup.warning.notSufficientConnectionsToXmrNetwork", xmrConnectionService.getMinBroadcastConnections())).show(); new Popup().information(Res.get("popup.warning.notSufficientConnectionsToXmrNetwork", xmrConnectionService.getMinBroadcastConnections())).show();
return false; return false;
@ -700,6 +701,10 @@ public class GUIUtil {
return false; return false;
} }
if (!isWalletSyncedWithinToleranceOrShowPopup(xmrWalletService)) {
return false;
}
try { try {
xmrConnectionService.verifyConnection(); xmrConnectionService.verifyConnection();
} catch (Exception e) { } catch (Exception e) {
@ -710,12 +715,11 @@ public class GUIUtil {
return true; return true;
} }
public static boolean isChainHeightSyncedWithinToleranceOrShowPopup(XmrConnectionService xmrConnectionService) { public static boolean isWalletSyncedWithinToleranceOrShowPopup(XmrWalletService xmrWalletService) {
if (!xmrConnectionService.isSyncedWithinTolerance()) { if (!xmrWalletService.isSyncedWithinTolerance()) {
new Popup().information(Res.get("popup.warning.chainNotSynced")).show(); new Popup().information(Res.get("popup.warning.walletNotSynced")).show();
return false; return false;
} }
return true; return true;
} }