diff --git a/core/src/main/java/io/bitsquare/btc/WalletService.java b/core/src/main/java/io/bitsquare/btc/WalletService.java index 6f8f52efd8..7c84d48176 100644 --- a/core/src/main/java/io/bitsquare/btc/WalletService.java +++ b/core/src/main/java/io/bitsquare/btc/WalletService.java @@ -21,6 +21,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.Service; +import io.bitsquare.app.Log; import io.bitsquare.btc.listeners.AddressConfidenceListener; import io.bitsquare.btc.listeners.BalanceListener; import io.bitsquare.btc.listeners.TxConfidenceListener; @@ -538,12 +539,14 @@ public class WalletService { @Override protected void progress(double percentage, int blocksLeft, Date date) { + Log.traceCall("percentage=" + percentage); super.progress(percentage, blocksLeft, date); UserThread.execute(() -> this.percentage.set(percentage / 100d)); } @Override protected void doneDownload() { + Log.traceCall(); super.doneDownload(); UserThread.execute(() -> this.percentage.set(1d)); } diff --git a/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java b/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java index 58a32bb75c..9609bdeb3c 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java +++ b/gui/src/main/java/io/bitsquare/gui/main/MainViewModel.java @@ -21,6 +21,7 @@ import com.google.inject.Inject; import io.bitsquare.alert.Alert; import io.bitsquare.alert.AlertManager; import io.bitsquare.app.BitsquareApp; +import io.bitsquare.app.Log; import io.bitsquare.app.Version; import io.bitsquare.arbitration.ArbitratorManager; import io.bitsquare.arbitration.Dispute; @@ -241,7 +242,7 @@ class MainViewModel implements ViewModel { walletServiceErrorMsg.set("You lost the connection to all bitcoin peers."); else if ((int) oldValue == 0 && (int) newValue > 0) walletServiceErrorMsg.set(null); - + numBTCPeers = (int) newValue; setBitcoinNetworkSyncProgress(walletService.downloadPercentageProperty().get()); }); @@ -561,9 +562,10 @@ class MainViewModel implements ViewModel { } private void setBitcoinNetworkSyncProgress(double value) { + Log.traceCall("btcSyncProgress=" + value); btcSyncProgress.set(value); String numPeers = "Nr. of peers: " + numBTCPeers; - if (value >= 1) { + if (value == 1) { stopBlockchainSyncTimeout(); btcSplashInfo.set(numPeers + " / synchronized with " + btcNetworkAsString); btcFooterInfo.set(numPeers + " / synchronized with " + btcNetworkAsString); @@ -576,7 +578,8 @@ class MainViewModel implements ViewModel { btcSplashInfo.set(numPeers + " / synchronizing with " + btcNetworkAsString + ": " + percentage); btcFooterInfo.set(numPeers + " / synchronizing " + btcNetworkAsString + ": " + percentage); - } else { + } else if (value == -1) { + // not ready yet btcSplashInfo.set(numPeers + " / connecting to " + btcNetworkAsString); btcFooterInfo.set(numPeers + " / connecting to " + btcNetworkAsString); }