fix restoring of xmr/wow wallets during swb restore process

This commit is contained in:
julian 2024-11-28 13:18:53 -06:00 committed by julian-CStack
parent dbf68f2a68
commit 9e988b8ba5

View file

@ -503,22 +503,33 @@ abstract class SWB {
viewOnlyData: viewOnlyData,
);
if (wallet is MoneroWallet /*|| wallet is WowneroWallet doesn't work.*/) {
await wallet.init(isRestore: true);
} else if (wallet is WowneroWallet) {
await wallet.init(isRestore: true);
} else {
switch (wallet.runtimeType) {
case const (EpiccashWallet):
await (wallet as EpiccashWallet).init(isRestore: true);
break;
case const (MoneroWallet):
await (wallet as MoneroWallet).init(isRestore: true);
break;
case const (WowneroWallet):
await (wallet as WowneroWallet).init(isRestore: true);
break;
default:
await wallet.init();
}
int restoreHeight = walletbackup['restoreHeight'] as int? ?? 0;
if (restoreHeight <= 0) {
if (wallet is EpiccashWallet || wallet is LibMoneroWallet) {
restoreHeight = 0;
} else {
restoreHeight = walletbackup['storedChainHeight'] as int? ?? 0;
}
}
Future<void>? restoringFuture;
if (!(wallet is LibMoneroWallet || wallet is EpiccashWallet)) {
final Future<void>? restoringFuture;
if (wallet is BitcoinFrostWallet) {
restoringFuture = wallet.recover(
isRescan: false,
@ -528,7 +539,6 @@ abstract class SWB {
} else {
restoringFuture = wallet.recover(isRescan: false);
}
}
uiState?.update(
walletId: info.walletId,