mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
update sync progress in realtime with native wallet
This commit is contained in:
parent
9a741e94fe
commit
fd328ceeea
@ -963,6 +963,20 @@ public class XmrWalletService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void syncWalletWithProgress() {
|
private void syncWalletWithProgress() {
|
||||||
|
|
||||||
|
// update sync progress in realtime with native wallet
|
||||||
|
if (wallet instanceof MoneroWalletFull) {
|
||||||
|
wallet.sync(new MoneroWalletListener() {
|
||||||
|
@Override
|
||||||
|
public void onSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) {
|
||||||
|
updateSyncProgress();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wasWalletSynced = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// poll wallet for progress
|
||||||
updateSyncProgress();
|
updateSyncProgress();
|
||||||
wallet.startSyncing(xmrConnectionService.getRefreshPeriodMs());
|
wallet.startSyncing(xmrConnectionService.getRefreshPeriodMs());
|
||||||
CountDownLatch latch = new CountDownLatch(1);
|
CountDownLatch latch = new CountDownLatch(1);
|
||||||
@ -1547,6 +1561,7 @@ public class XmrWalletService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) {
|
public void onSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) {
|
||||||
|
ThreadUtils.submitToPool(() -> updateSyncProgress());
|
||||||
for (MoneroWalletListenerI listener : walletListeners) ThreadUtils.submitToPool(() -> listener.onSyncProgress(height, startHeight, endHeight, percentDone, message));
|
for (MoneroWalletListenerI listener : walletListeners) ThreadUtils.submitToPool(() -> listener.onSyncProgress(height, startHeight, endHeight, percentDone, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user