fix disappearing progressbar during sync (#470)

This commit is contained in:
m2049r 2018-11-13 21:58:32 +01:00 committed by GitHub
parent 5bfb920979
commit be04185481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -379,12 +379,13 @@ public class WalletFragment extends Fragment
throw new IllegalStateException("WalletService not bound.");
Wallet.ConnectionStatus daemonConnected = activityCallback.getConnectionStatus();
if (daemonConnected == Wallet.ConnectionStatus.ConnectionStatus_Connected) {
long daemonHeight = activityCallback.getDaemonHeight();
if (!wallet.isSynchronized()) {
long n = daemonHeight - wallet.getBlockChainHeight();
long daemonHeight = activityCallback.getDaemonHeight();
long walletHeight = wallet.getBlockChainHeight();
long n = daemonHeight - walletHeight;
sync = getString(R.string.status_syncing) + " " + formatter.format(n) + " " + getString(R.string.status_remaining);
if (firstBlock == 0) {
firstBlock = wallet.getBlockChainHeight();
firstBlock = walletHeight;
}
int x = 100 - Math.round(100f * n / (1f * daemonHeight - firstBlock));
if (x == 0) x = 101; // indeterminate