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() {
if (daemon == null) return false;
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 == 0) return true; // monero-daemon-rpc sync_info's target_height returns 0 when node is fully synced
long currentHeight = chainHeight.get();
if (targetHeight - currentHeight <= 3) { // synced if not more than 3 blocks behind target height
return true;
}
Long targetHeight = getTargetHeight();
if (targetHeight == null) return false;
if (targetHeight - chainHeight.get() <= 3) return true; // synced if within 3 blocks of target height
log.warn("Our chain height: {} is out of sync with peer nodes chain height: {}", chainHeight.get(), targetHeight);
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 ------------------------------
public ReadOnlyIntegerProperty numPeersProperty() {

View file

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

View file

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

View file

@ -338,7 +338,7 @@ public abstract class SupportManager {
p2PService.isBootstrapped() &&
xmrConnectionService.isDownloadComplete() &&
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) -> {
if (xmrWalletService.isWalletSynced())
tryApplyMessages();
});
xmrConnectionService.numPeersProperty().addListener((observable, oldValue, newValue) -> {
if (xmrConnectionService.hasSufficientPeersForBroadcast())
if (xmrWalletService.isSyncedWithinTolerance())
tryApplyMessages();
});

View file

@ -588,7 +588,7 @@ public abstract class Trade implements Tradable, Model {
});
// handle daemon changes with max parallelization
xmrWalletService.getConnectionsService().addConnectionListener(newConnection -> {
xmrWalletService.getConnectionService().addConnectionListener(newConnection -> {
HavenoUtils.submitTask(() -> onConnectionChanged(newConnection));
});
@ -643,7 +643,7 @@ public abstract class Trade implements Tradable, Model {
new Thread(() -> {
GenUtils.waitFor(1000);
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();
// complete disputed trade
@ -758,7 +758,7 @@ public abstract class Trade implements Tradable, Model {
}
public void checkDaemonConnection() {
XmrConnectionService xmrConnectionService = xmrWalletService.getConnectionsService();
XmrConnectionService xmrConnectionService = xmrWalletService.getConnectionService();
xmrConnectionService.checkConnection();
xmrConnectionService.verifyConnection();
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) {
syncNormalStartTime = System.currentTimeMillis();
setWalletRefreshPeriod(xmrWalletService.getConnectionsService().getRefreshPeriodMs());
setWalletRefreshPeriod(xmrWalletService.getConnectionService().getRefreshPeriodMs());
UserThread.runAfter(() -> {
if (!isShutDown && System.currentTimeMillis() >= syncNormalStartTime + syncNormalDuration) updateWalletRefreshPeriod();
}, syncNormalDuration);
@ -1684,7 +1684,7 @@ public abstract class Trade implements Tradable, Model {
*/
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)
if (reprocessCount < retryCycles) return xmrWalletService.getConnectionsService().getRefreshPeriodMs() / 1000;
if (reprocessCount < retryCycles) return xmrWalletService.getConnectionService().getRefreshPeriodMs() / 1000;
long delay = 60;
for (int i = retryCycles; i < reprocessCount; i++) delay *= 2;
return Math.min(MAX_REPROCESS_DELAY_SECONDS, delay);
@ -1785,7 +1785,7 @@ public abstract class Trade implements Tradable, Model {
if (!wasWalletSynced) {
wasWalletSynced = true;
if (xmrWalletService.isProxyApplied(wasWalletSynced)) {
onConnectionChanged(xmrWalletService.getConnectionsService().getConnection());
onConnectionChanged(xmrWalletService.getConnectionService().getConnection());
}
}
@ -1843,7 +1843,7 @@ public abstract class Trade implements Tradable, Model {
try {
// log warning if wallet is too far behind daemon
MoneroDaemonInfo lastInfo = xmrWalletService.getConnectionsService().getLastInfo();
MoneroDaemonInfo lastInfo = xmrWalletService.getConnectionService().getLastInfo();
long walletHeight = wallet.getHeight();
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());
@ -1924,7 +1924,7 @@ public abstract class Trade implements Tradable, Model {
}
} catch (Exception e) {
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() {
if (isIdling()) return IDLE_SYNC_PERIOD_MS;
return xmrWalletService.getConnectionsService().getRefreshPeriodMs();
return xmrWalletService.getConnectionService().getRefreshPeriodMs();
}
private void setStateDepositsPublished() {

View file

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

View file

@ -215,10 +215,6 @@ public class XmrWalletService {
return accountService.getPassword() != null;
}
public boolean isWalletSynced() {
return downloadPercentageProperty().get() == 1d;
}
public ReadOnlyDoubleProperty downloadPercentageProperty() {
return downloadListener.percentageProperty();
}
@ -227,15 +223,27 @@ public class XmrWalletService {
downloadListener.doneDownload();
}
public boolean isDownloadComplete() {
return downloadPercentageProperty().get() == 1d;
}
public LongProperty walletHeightProperty() {
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() {
return xmrConnectionService.getDaemon();
}
public XmrConnectionService getConnectionsService() {
public XmrConnectionService getConnectionService() {
return xmrConnectionService;
}
@ -721,6 +729,7 @@ public class XmrWalletService {
log.info("Syncing main wallet");
long time = System.currentTimeMillis();
wallet.sync(); // blocking
walletHeight.set(wallet.getHeight());
wasWalletSynced = true;
log.info("Done syncing main wallet in " + (System.currentTimeMillis() - time) + " ms");
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.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.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.tooLargePercentageValue=You cannot set a percentage of 100% or larger.
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.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.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.tooLargePercentageValue=Nelze nastavit procento 100% nebo větší.
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.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.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.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%

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.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.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.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%

View file

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

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.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.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.tooLargePercentageValue=Non è possibile impostare una percentuale del 100% o superiore.
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.notSufficientConnectionsToXmrNetwork=少なくとも{0}のビットコインネットワークへの接続が確立されるまでお待ちください。
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.tooLargePercentageValue=100%以上のパーセントを設定できません
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.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.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.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%

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.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.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.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%

View file

@ -1579,7 +1579,7 @@ popup.warning.noMediatorsAvailable=There are no mediators available.
popup.warning.notFullyConnected=Необходимо дождаться полного подключения к сети.\nОно может занять до 2 минут.
popup.warning.notSufficientConnectionsToXmrNetwork=Необходимо дождаться не менее {0} соединений с сетью Биткойн.
popup.warning.downloadNotComplete=Необходимо дождаться завершения загрузки недостающих блоков сети Биткойн.
popup.warning.chainNotSynced=Кошелек Haveno не синхронизирован с последней высотой блокчейна. Пожалуйста, подождите, пока кошелек синхронизируется, или проверьте ваше соединение.
popup.warning.walletNotSynced=Кошелек Haveno не синхронизирован с последней высотой блокчейна. Пожалуйста, подождите, пока кошелек синхронизируется, или проверьте ваше соединение.
popup.warning.removeOffer=Действительно хотите удалить это предложение?
popup.warning.tooLargePercentageValue=Нельзя установить процент в размере 100% или выше.
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.notSufficientConnectionsToXmrNetwork=คุณต้องรอจนกว่าจะมีการเชื่อมต่อกับเครือข่าย Monero อย่างน้อย {0} รายการ
popup.warning.downloadNotComplete=คุณต้องรอจนกว่าการดาวน์โหลดบล็อค Monero ที่ขาดหายไปจะเสร็จสมบูรณ์
popup.warning.chainNotSynced=กระเป๋า Haveno ไม่ได้ปรับข้อมูลกับความสูงของบล็อกเชนล่าสุด โปรดรอให้กระเป๋าปรับข้อมูลหรือตรวจสอบการเชื่อมต่อของคุณ
popup.warning.walletNotSynced=กระเป๋า Haveno ไม่ได้ปรับข้อมูลกับความสูงของบล็อกเชนล่าสุด โปรดรอให้กระเป๋าปรับข้อมูลหรือตรวจสอบการเชื่อมต่อของคุณ
popup.warning.removeOffer=คุณแน่ใจหรือไม่ว่าต้องการนำข้อเสนอนั้นออก
popup.warning.tooLargePercentageValue=คุณไม่สามารถกำหนดเปอร์เซ็นต์เป็น 100% หรือมากกว่าได้
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.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.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.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%

View file

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

View file

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

View file

@ -172,7 +172,7 @@ public class TxIdTextField extends AnchorPane {
MoneroTx tx = null;
try {
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) {
// do nothing
}

View file

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

View file

@ -553,7 +553,7 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
boolean canCreateOrTakeOffer() {
return GUIUtil.canCreateOrTakeOfferOrShowPopup(user, navigation) &&
GUIUtil.isChainHeightSyncedWithinToleranceOrShowPopup(openOfferManager.getXmrConnectionService()) &&
GUIUtil.isWalletSyncedWithinToleranceOrShowPopup(openOfferManager.getXmrWalletService()) &&
GUIUtil.isBootstrappedOrShowPopup(p2PService);
}

View file

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

View file

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