mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-20 14:19:05 +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) + "%";
|
final progressPercent = (progress * 100).toStringAsPrecision(5) + "%";
|
||||||
bool shouldSync = i == 0;
|
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}";
|
String title = "${walletTypeToCryptoCurrency(wallet.type).title} - ${wallet.name}";
|
||||||
late String content;
|
late String content;
|
||||||
|
|
||||||
|
@ -278,6 +265,19 @@ Future<void> onStart(ServiceInstance service) async {
|
||||||
// await Future.delayed(const Duration(seconds: 10));
|
// 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) {
|
if (syncStatus is SyncingSyncStatus) {
|
||||||
final blocksLeft = syncStatus.blocksLeft;
|
final blocksLeft = syncStatus.blocksLeft;
|
||||||
content = "$blocksLeft Blocks Left";
|
content = "$blocksLeft Blocks Left";
|
||||||
|
@ -382,7 +382,8 @@ Future<void> onStart(ServiceInstance service) async {
|
||||||
final wallet = syncingWallets.first;
|
final wallet = syncingWallets.first;
|
||||||
final syncStatus = wallet.syncStatus;
|
final syncStatus = wallet.syncStatus;
|
||||||
if (syncStatus is! SyncingSyncStatus) return;
|
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());
|
lastFewProgresses.add(syncStatus.progress());
|
||||||
if (lastFewProgresses.length < 10) return;
|
if (lastFewProgresses.length < 10) return;
|
||||||
// limit list size to 10:
|
// limit list size to 10:
|
||||||
|
|
Loading…
Reference in a new issue