fix: old block errors

This commit is contained in:
julian 2023-06-08 14:25:09 -06:00
parent 885310395e
commit 53be1f53db
2 changed files with 43 additions and 17 deletions

View file

@ -733,17 +733,29 @@ class BananoWallet extends CoinServiceAPI
@override
Future<void> refresh() async {
if (refreshMutex) {
Logging.instance.log(
"$walletId $walletName refreshMutex denied",
level: LogLevel.Info,
);
return;
} else {
refreshMutex = true;
}
await _prefs.init();
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.syncing,
walletId,
coin,
),
);
try {
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.syncing,
walletId,
coin,
),
);
await _prefs.init();
await updateChainHeight();
await updateTransactions();
await updateBalance();
@ -768,6 +780,8 @@ class BananoWallet extends CoinServiceAPI
),
);
}
refreshMutex = false;
}
@override

View file

@ -747,17 +747,27 @@ class NanoWallet extends CoinServiceAPI
@override
Future<void> refresh() async {
await _prefs.init();
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.syncing,
walletId,
coin,
),
);
if (refreshMutex) {
Logging.instance.log(
"$walletId $walletName refreshMutex denied",
level: LogLevel.Info,
);
return;
} else {
refreshMutex = true;
}
try {
await _prefs.init();
GlobalEventBus.instance.fire(
WalletSyncStatusChangedEvent(
WalletSyncStatus.syncing,
walletId,
coin,
),
);
await updateChainHeight();
await updateTransactions();
await updateBalance();
@ -782,6 +792,8 @@ class NanoWallet extends CoinServiceAPI
),
);
}
refreshMutex = false;
}
@override