mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 09:29:48 +00:00
testing
This commit is contained in:
parent
c2e764f77b
commit
d4346e480c
1 changed files with 15 additions and 14 deletions
|
@ -251,19 +251,6 @@ Future<void> onStart(ServiceInstance service) async {
|
|||
final progressPercent = (progress * 100).toStringAsPrecision(5) + "%";
|
||||
bool shouldSync = i == 0;
|
||||
|
||||
if (progress > 0.999 && shouldSync) {
|
||||
syncedTicks++;
|
||||
if (syncedTicks > 5) {
|
||||
syncedTicks = 0;
|
||||
printV("WALLET $i SYNCED");
|
||||
wallet.stopSync();
|
||||
// pop the first wallet from the list
|
||||
standbyWallets.add(syncingWallets.removeAt(i));
|
||||
flutterLocalNotificationsPlugin.cancelAll();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
String title = "${walletTypeToCryptoCurrency(wallet.type).title} - ${wallet.name}";
|
||||
late String content;
|
||||
|
||||
|
@ -278,6 +265,19 @@ Future<void> onStart(ServiceInstance service) async {
|
|||
// await Future.delayed(const Duration(seconds: 10));
|
||||
}
|
||||
|
||||
if (progress > 0.999 || syncStatus is SyncedSyncStatus) {
|
||||
syncedTicks++;
|
||||
if (syncedTicks > 5) {
|
||||
syncedTicks = 0;
|
||||
printV("WALLET $i SYNCED");
|
||||
wallet.stopSync();
|
||||
// pop the first wallet from the list
|
||||
standbyWallets.add(syncingWallets.removeAt(i));
|
||||
flutterLocalNotificationsPlugin.cancelAll();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (syncStatus is SyncingSyncStatus) {
|
||||
final blocksLeft = syncStatus.blocksLeft;
|
||||
content = "$blocksLeft Blocks Left";
|
||||
|
@ -382,7 +382,8 @@ Future<void> onStart(ServiceInstance service) async {
|
|||
final wallet = syncingWallets.first;
|
||||
final syncStatus = wallet.syncStatus;
|
||||
if (syncStatus is! SyncingSyncStatus) return;
|
||||
if (syncStatus.progress() > SYNC_THRESHOLD) return; // don't bother checking if we're close to synced
|
||||
if (syncStatus.progress() > SYNC_THRESHOLD)
|
||||
return; // don't bother checking if we're close to synced
|
||||
lastFewProgresses.add(syncStatus.progress());
|
||||
if (lastFewProgresses.length < 10) return;
|
||||
// limit list size to 10:
|
||||
|
|
Loading…
Reference in a new issue